Skip to content

Build and upload xcstringslint release binary #8

Build and upload xcstringslint release binary

Build and upload xcstringslint release binary #8

Workflow file for this run

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
run: |
VERSION="${{ github.ref_name }}"
ARTIFACT_FOLDER_NAME="XCStringsLint.artifactbundle/xcstringslint-$(VERSION)-macos"
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