├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── appcast.yml ├── license └── readme.md /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/workflows/appcast.yml: -------------------------------------------------------------------------------- 1 | name: Generate and Publish Appcast 2 | 3 | on: 4 | workflow_call: 5 | secrets: 6 | SPARKLE_PRIVATE_KEY: 7 | required: true 8 | 9 | jobs: 10 | build: 11 | runs-on: macos-latest 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v4 16 | 17 | - name: Get latest release info 18 | id: get_release 19 | uses: actions/github-script@v7 20 | with: 21 | script: | 22 | const release = await github.rest.repos.getLatestRelease({ 23 | owner: context.repo.owner, 24 | repo: context.repo.repo, 25 | }); 26 | 27 | const asset = release.data.assets[0]; 28 | const version = release.data.tag_name.replace(/^v/, ''); 29 | core.setOutput('version', version); 30 | core.setOutput('asset_url', asset.browser_download_url); 31 | core.setOutput('asset_name', asset.name); 32 | 33 | const {body} = release.data; 34 | 35 | const criticalMarker = ''; 36 | const isCritical = body.includes(criticalMarker); 37 | core.setOutput('is_critical', isCritical); 38 | 39 | const cleanedReleaseNotes = body.replace(criticalMarker, ''); 40 | core.setOutput('release_notes', cleanedReleaseNotes); 41 | 42 | - name: Download release asset 43 | run: | 44 | mkdir archives 45 | curl --location --output "archives/${{ steps.get_release.outputs.asset_name }}" "${{ steps.get_release.outputs.asset_url }}" 46 | 47 | - name: Convert Markdown to HTML 48 | run: | 49 | ASSET_NAME="${{ steps.get_release.outputs.asset_name }}" 50 | echo "${{ steps.get_release.outputs.release_notes }}" | npx marked > "archives/${ASSET_NAME%.zip}.html" 51 | 52 | - name: Generate appcast.xml 53 | run: | 54 | curl --location https://github.com/sparkle-project/Sparkle/releases/download/2.6.4/Sparkle-2.6.4.tar.xz | tar --extract --xz 55 | 56 | CRITICAL_UPDATE_ARGUMENT="" 57 | if [ "${{ steps.get_release.outputs.is_critical }}" == "true" ]; then 58 | CRITICAL_UPDATE_ARGUMENT="--critical-update-version ${{ steps.get_release.outputs.version }}" 59 | fi 60 | 61 | echo "${{ secrets.SPARKLE_PRIVATE_KEY }}" | ./bin/generate_appcast \ 62 | --download-url-prefix "${{ github.server_url }}/${{ github.repository }}/releases/download/v${{ steps.get_release.outputs.version }}/" \ 63 | --embed-release-notes \ 64 | --ed-key-file - \ 65 | $CRITICAL_UPDATE_ARGUMENT \ 66 | archives 67 | mkdir _site 68 | mv archives/appcast.xml _site/appcast.xml 69 | 70 | - name: Setup GitHub Pages 71 | uses: actions/configure-pages@v5 72 | 73 | - name: Upload appcast.xml 74 | uses: actions/upload-pages-artifact@v3 75 | 76 | deploy: 77 | permissions: 78 | pages: write 79 | id-token: write 80 | environment: 81 | name: github-pages 82 | runs-on: ubuntu-latest 83 | needs: build 84 | steps: 85 | - name: Deploy to GitHub Pages 86 | id: deployment 87 | uses: actions/deploy-pages@v4 88 | # uses: sindresorhus/deploy-pages@2b074ac0fbb49199d6d4468cd1f84b759e997e62 89 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Appcast Workflow 2 | 3 | > Reusable workflow to generate [Sparkle `appcast.xml`](https://sparkle-project.org/documentation/) for my apps 4 | 5 | Fork and use this for your own apps if you'd like. I'm happy to accept improvements, but I won't be accepting additional configuration. This workflow is tailored to my needs. 6 | 7 | ## Setup 8 | 9 | - Create a new repo. 10 | - Enable GitHub Pages in the repo settings, then go to “Environments”, and in “Deployment branches and tags”, select “No restriction”. 11 | - Export the [EdDSA private key](https://sparkle-project.org/documentation/#eddsa-ed25519-signatures) from Sparkle (`./generate_keys -x private-key-file`) and add it as a repo secret called `SPARKLE_PRIVATE_KEY`. 12 | - Add [this workflow file](https://github.com/sindresorhus/quickgpt-meta/blob/main/.github/workflows/appcast.yaml) to the repo. 13 | - Add the GitHub Pages URL to your app's Info.plist with the key `SUFeedURL`. For example, `https://sindresorhus.com/quickgpt-meta/appcast.xml`. 14 | 15 | ## Publish update 16 | 17 | - Create a new release on the repo and add the zipped app bundle as a binary to the release. 18 | - To mark an update as [criticial](https://sparkle-project.org/documentation/publishing/#critical-updates), include `` in the release notes. 19 | --------------------------------------------------------------------------------