chore: release v1.0.2 #3
Workflow file for this run
This file contains hidden or 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
| name: macOS Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_tag: | |
| description: "GitHub release tag to publish artifacts to" | |
| required: true | |
| default: "v1.0.0" | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos: | |
| name: Build unsigned macOS package | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run frontend tests | |
| run: npm test | |
| - name: Run Rust tests | |
| working-directory: src-tauri | |
| run: cargo test | |
| - name: Build unsigned universal macOS app | |
| run: > | |
| npm run tauri build -- | |
| --target universal-apple-darwin | |
| --bundles app,dmg | |
| --ci | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| - name: Collect macOS artifacts | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| VERSION="$(node -p "require('./package.json').version")" | |
| mkdir -p artifacts | |
| APP_PATH="$(find src-tauri/target -type d -path '*/bundle/macos/SkillMaster.app' -print -quit)" | |
| DMG_PATH="$(find src-tauri/target -type f -path '*/bundle/dmg/*.dmg' -print -quit)" | |
| TAR_PATH="$(find src-tauri/target -type f -name "*.tar.gz" -print -quit)" | |
| SIG_PATH="$(find src-tauri/target -type f -name "*.tar.gz.sig" -print -quit)" | |
| if [[ -z "${APP_PATH}" ]]; then | |
| echo "SkillMaster.app was not generated" >&2 | |
| exit 1 | |
| fi | |
| ditto -c -k --sequesterRsrc --keepParent "${APP_PATH}" "artifacts/SkillMaster_${VERSION}_universal.app.zip" | |
| if [[ -n "${DMG_PATH}" ]]; then | |
| cp "${DMG_PATH}" "artifacts/SkillMaster_${VERSION}_universal.dmg" | |
| fi | |
| if [[ -z "${TAR_PATH}" ]]; then | |
| echo "macOS updater archive (.tar.gz) was not generated" >&2 | |
| exit 1 | |
| fi | |
| if [[ -z "${SIG_PATH}" ]]; then | |
| echo "macOS updater signature (.tar.gz.sig) was not generated" >&2 | |
| exit 1 | |
| fi | |
| cp "${TAR_PATH}" "artifacts/SkillMaster_${VERSION}_universal.app.tar.gz" | |
| cp "${SIG_PATH}" "artifacts/SkillMaster_${VERSION}_universal.app.tar.gz.sig" | |
| shasum -a 256 artifacts/* > artifacts/SHA256SUMS.txt | |
| - name: Upload workflow artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: skillmaster-macos-${{ inputs.release_tag || github.ref_name }} | |
| path: artifacts/* | |
| - name: Publish artifacts to GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }} | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if ! gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then | |
| gh release create "${RELEASE_TAG}" --title "SkillMaster ${RELEASE_TAG#v}" --notes "SkillMaster ${RELEASE_TAG#v} release." | |
| fi | |
| gh release upload "${RELEASE_TAG}" artifacts/* --clobber | |
| - name: Publish updater manifest when all platform artifacts exist | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }} | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rm -rf release-signatures | |
| mkdir -p release-signatures | |
| gh release download "${RELEASE_TAG}" --pattern "*.sig" --dir release-signatures --clobber | |
| gh release view "${RELEASE_TAG}" --json assets,body,publishedAt > release-assets.json | |
| if node .github/scripts/build-latest-json.mjs release-assets.json release-signatures latest.json; then | |
| gh release upload "${RELEASE_TAG}" latest.json --clobber | |
| else | |
| echo "Skipping latest.json upload until all updater artifacts are present." | |
| fi |