Build and upload xcstringslint release binary #9
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 macOS binary | |
id: build | |
run: | | |
swift build -c release --arch x86_64 --arch arm64 | |
mv $(swift build -c release --arch x86_64 --arch arm64 --show-bin-path) artifact | |
echo "path=artifact/xcstringslint" >> "$GITHUB_OUTPUT" | |
- name: Build artifact bundle | |
env: | |
ARTIFACT_FOLDER_NAME: "XCStringsLint.artifactbundle/xcstringslint-${{ github.ref_name }}-macos" | |
VERSION: ${{ github.ref_name }} | |
run: | | |
mkdir -p "$(ARTIFACT_FOLDER_NAME)/bin" | |
sed 's/__VERSION__/$(VERSION)/g' .github/artifactbundle.json.template > "$(ARTIFACT_FOLDER_NAME)/info.json" | |
cp -f "${{ steps.build.outputs.path }}" "$(ARTIFACT_FOLDER_NAME)/bin" | |
cp -f "LICENSE" "$(ARTIFACT_FOLDER_NAME)" | |
(zip -yr - "XCStringsLint.artifactbundle") > "./XCStringsLint-macos.artifactbundle.zip" | |
- name: Upload binary to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: XCStringsLint-macos.artifactbundle.zip |