Workflow file for this run
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
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
name: Build and upload xcstringslint release binary | |
jobs: | |
build-macos: | |
name: Build macOS Executable | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build artifact bundle | |
env: | |
ARTIFACT_FOLDER_NAME: "XCStringsLint.artifactbundle" | |
VERSION: ${{ github.ref_name }} | |
run: | | |
swift build -c release --arch x86_64 --arch arm64 | |
BINARY_PATH=$(swift build -c release --arch x86_64 --arch arm64 --show-bin-path) | |
mkdir -p "$ARTIFACT_FOLDER_NAME/xcstringslint-$VERSION-macos/bin" | |
cp -f "$BINARY_PATH/xcstringslint" "$ARTIFACT_FOLDER_NAME/xcstringslint-$VERSION-macos/bin" | |
cp -r -- $BINARY_PATH/*.bundle "$ARTIFACT_FOLDER_NAME/xcstringslint-$VERSION-macos/bin" | |
sed "s/__VERSION__/$VERSION/g" .github/artifactbundle.json.template > "$ARTIFACT_FOLDER_NAME/info.json" | |
cp -f "LICENSE" "$ARTIFACT_FOLDER_NAME" | |
(zip -yr - "$ARTIFACT_FOLDER_NAME") > "./$ARTIFACT_FOLDER_NAME.zip" | |
- name: Upload binary to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: XCStringsLint.artifactbundle.zip |