Prepare v0.1.0-beta.5 #5
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Package and publish | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify tag matches app version | |
| if: github.event_name == 'push' | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| APP_VERSION=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' scripts/AppBundleInfo.plist) | |
| case "$TAG" in | |
| "v$APP_VERSION"|"v$APP_VERSION-beta."*) ;; | |
| *) | |
| echo "Tag $TAG must match v$APP_VERSION or v$APP_VERSION-beta.N" | |
| exit 1 | |
| ;; | |
| esac | |
| - name: Run tests | |
| run: swift test | |
| - name: Package app | |
| run: ./scripts/package-release.sh | |
| - name: Publish GitHub release | |
| if: github.event_name == 'push' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| PRERELEASE=() | |
| if [[ "$TAG" == *-beta.* ]]; then | |
| PRERELEASE=(--prerelease) | |
| fi | |
| gh release create "$TAG" \ | |
| .build/release-package/Sajilo-macos-arm64.dmg \ | |
| .build/release-package/Sajilo-macos-arm64.zip \ | |
| --title "Sajilo ${TAG#v}" \ | |
| "${PRERELEASE[@]}" \ | |
| --generate-notes | |
| - name: Upload release archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Sajilo-macos-arm64 | |
| path: | | |
| .build/release-package/Sajilo-macos-arm64.dmg | |
| .build/release-package/Sajilo-macos-arm64.zip | |
| retention-days: 14 |