From c9d48f6d0950804cd90c6fdc1a01ef5be95dc453 Mon Sep 17 00:00:00 2001 From: cuiko Date: Sat, 23 May 2026 02:22:34 +0800 Subject: [PATCH] ci: Add tag-triggered release workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumping the version, committing, and tagging \`vx.y.z\` should be the entire release ritual — the rest is mechanical. Add \`.github/workflows/release.yml\` that fires on \`v*\` tag pushes, runs \`make dist\` on a macos-14 runner, and creates a GitHub Release with the DMG attached. Release notes use \`gh release create --generate-notes\`, which derives them from PR titles merged since the previous tag (same algorithm as the "Generate release notes" button in the GitHub UI). This removes the manual \`make dist\` + \`gh release create\` steps from the release flow entirely. The workflow needs \`contents: write\` to create the release; no other permissions or secrets are required since \`GITHUB_TOKEN\` covers the release API surface. --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4d77c8d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: macos-14 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Show toolchain + run: swift --version + - name: Build DMG + run: make dist + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "${GITHUB_REF_NAME}" \ + dist/TermIMS.dmg \ + --title "${GITHUB_REF_NAME}" \ + --generate-notes