Inline release notes in appcast so Sparkle stops loading the GitHub site #10
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: | |
| inputs: | |
| tag: | |
| description: 'Tag to release (e.g. v0.1.0). Must already exist.' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: macos-26 | |
| env: | |
| SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Import Developer ID certificate | |
| env: | |
| BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
| P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| set -euo pipefail | |
| CERT_PATH="$RUNNER_TEMP/cert.p12" | |
| KEYCHAIN_PATH="$RUNNER_TEMP/build.keychain-db" | |
| echo "$BUILD_CERTIFICATE_BASE64" | base64 --decode > "$CERT_PATH" | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security import "$CERT_PATH" \ | |
| -P "$P12_PASSWORD" \ | |
| -A -t cert -f pkcs12 \ | |
| -k "$KEYCHAIN_PATH" | |
| security list-keychain -d user -s "$KEYCHAIN_PATH" $(security list-keychain -d user | xargs) | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: \ | |
| -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" >/dev/null | |
| - name: Resolve tag | |
| id: resolve_tag | |
| run: | | |
| if [ -n "${{ github.event.inputs.tag }}" ]; then | |
| echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate release notes | |
| id: notes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.resolve_tag.outputs.tag }} | |
| run: | | |
| set -euo pipefail | |
| NOTES_MD="$RUNNER_TEMP/release_notes.md" | |
| NOTES_HTML="$RUNNER_TEMP/release_notes.html" | |
| gh api -X POST "/repos/${{ github.repository }}/releases/generate-notes" \ | |
| -f tag_name="$TAG" \ | |
| --jq .body > "$NOTES_MD" | |
| gh api -X POST /markdown \ | |
| -F text=@"$NOTES_MD" \ | |
| -f mode=gfm \ | |
| -f context="${{ github.repository }}" > "$NOTES_HTML" | |
| echo "notes_md=$NOTES_MD" >> "$GITHUB_OUTPUT" | |
| echo "notes_html=$NOTES_HTML" >> "$GITHUB_OUTPUT" | |
| - name: Build, sign, notarize, and package | |
| env: | |
| SPARKLE_RELEASE_NOTES_FILE: ${{ steps.notes.outputs.notes_html }} | |
| run: ./scripts/package_release.sh | |
| - name: Upload artifacts to GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.resolve_tag.outputs.tag }} | |
| NOTES_MD: ${{ steps.notes.outputs.notes_md }} | |
| run: | | |
| set -euo pipefail | |
| if ! gh release view "$TAG" >/dev/null 2>&1; then | |
| gh release create "$TAG" --title "Notchy $TAG" --notes-file "$NOTES_MD" | |
| fi | |
| ASSETS=(dist/Notchy-*.zip dist/Notchy-*.dmg) | |
| if [ -f dist/appcast.xml ]; then | |
| ASSETS+=(dist/appcast.xml) | |
| fi | |
| gh release upload "$TAG" "${ASSETS[@]}" --clobber | |
| - name: Clean up keychain | |
| if: always() | |
| run: | | |
| security delete-keychain "$RUNNER_TEMP/build.keychain-db" || true |