-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Focus on being a CLI and support for use from an SPM plugin instead o…
…f Tuist plugin (#2) * Run SwiftFormat and SwiftLint via Mise * Remove Tuist plugin code * Update swiftformat config * Remove handling for tuist exectuable from main function * Remove Tuist references from README * Update contributing guide * CI lint workflow using Mise * Add Mint installation instructions * Script to build zipped binary and artifact bundle * Update release workflow to include zipped binary and SPM artifact bundle * Lint CI step should run lint command, rather than format
- Loading branch information
Showing
16 changed files
with
154 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[tools] | ||
swiftformat = "0.53.1" | ||
swiftlint = "0.54.0" | ||
|
||
[settings] | ||
legacy_version_file = false | ||
yes = true | ||
disable_tools = ['node', 'ruby', 'go'] | ||
experimental = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Run code formatting" | ||
# mise sources=["**/*.swift"] | ||
|
||
OUTPUT_DIR=".build/lint/reports" | ||
mkdir -p "${OUTPUT_DIR}" | ||
|
||
swiftlint --fix --strict --quiet --reporter html --output "${OUTPUT_DIR}/swiftlint.html" | ||
swiftformat . --report "${OUTPUT_DIR}/swiftformat.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Run code linting" | ||
# mise sources=["**/*.swift"] | ||
|
||
OUTPUT_DIR=".build/lint/reports" | ||
mkdir -p "${OUTPUT_DIR}" | ||
|
||
swiftformat . --lint --report "${OUTPUT_DIR}/swiftformat.json" | ||
swiftlint --strict --quiet --reporter html --output "${OUTPUT_DIR}/swiftlint.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
|
||
# file options | ||
|
||
--exclude .build,Derived,Tuist/Dependencies | ||
--exclude .build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
REGEX="static let current = \"([0-9]+.[0-9]+.[0-9]+)\"" | ||
while IFS= read -r line; do | ||
if [[ $line =~ $REGEX ]] | ||
then | ||
echo "${BASH_REMATCH[1]}" | ||
break | ||
fi | ||
done < Sources/CloakKit/Version/Version.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
VERSION=$(./Scripts/get-version.sh) | ||
ARTIFACT_BUNDLE=cloakswift-$VERSION.artifactbundle | ||
ARTIFACT_BUNDLE_BIN=$ARTIFACT_BUNDLE/cloakswift/bin | ||
BINARY_DIR=bin | ||
OUTPUT_BINARY=$BINARY_DIR/cloakswift | ||
|
||
mkdir -p $BINARY_DIR | ||
mkdir -p $ARTIFACT_BUNDLE | ||
mkdir -p $ARTIFACT_BUNDLE_BIN | ||
|
||
# Copy files into bundle | ||
cp LICENSE $ARTIFACT_BUNDLE | ||
cp README.md $ARTIFACT_BUNDLE | ||
cp CHANGELOG.md $ARTIFACT_BUNDLE | ||
|
||
# Create bundle info.json from template, replacing version | ||
INFO_TEMPLATE=Scripts/spm-artifact-bundle-info.template | ||
sed 's/__VERSION__/'"${VERSION}"'/g' $INFO_TEMPLATE > "${ARTIFACT_BUNDLE}/info.json" | ||
|
||
# Build multi-arch binary | ||
swift build --disable-sandbox -c release --arch arm64 | ||
swift build --disable-sandbox -c release --arch x86_64 | ||
lipo -create -output $OUTPUT_BINARY .build/arm64-apple-macosx/release/cloakswift .build/x86_64-apple-macosx/release/cloakswift | ||
strip -rSTX ${OUTPUT_BINARY} | ||
|
||
# Copy macOS binary into bundle | ||
cp $OUTPUT_BINARY $ARTIFACT_BUNDLE_BIN | ||
|
||
# ZIP binary | ||
FILENAME="cloakswift-v$VERSION.zip" | ||
zip -r -j $FILENAME $OUTPUT_BINARY | ||
|
||
# ZIP artifact bundle | ||
ARTIFACT_BUNDLE_FILENAME="cloakswift-v$VERSION.artifactbundle.zip" | ||
zip -r -X $ARTIFACT_BUNDLE_FILENAME $ARTIFACT_BUNDLE | ||
|
||
# Clean-up | ||
rm -rf $BINARY_DIR | ||
rm -rf $ARTIFACT_BUNDLE | ||
|
||
if [ -z "${GITHUB_ACTIONS}" ]; then | ||
echo "Binary created: $FILENAME" | ||
echo "SPM artifact bundle created: $ARTIFACT_BUNDLE_FILENAME" | ||
else | ||
echo "FILENAME=${FILENAME}" >> $GITHUB_OUTPUT | ||
echo "ARTIFACT_BUNDLE_FILENAME=${ARTIFACT_BUNDLE_FILENAME}" >> $GITHUB_OUTPUT | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"schemaVersion": "1.0", | ||
"artifacts": { | ||
"cloakswift": { | ||
"version": "__VERSION__", | ||
"type": "executable", | ||
"variants": [ | ||
{ | ||
"path": "cloakswift/bin/cloakswift", | ||
"supportedTriples": ["x86_64-apple-macosx", "arm64-apple-macosx"] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.