diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..6bdd8cb --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,21 @@ +name: PR Title + +# Validate that PR titles follow the Conventional Commits specification +# (e.g. "feat: ...", "fix: ...", "ci: ..."). This is enforced so that +# release-drafter and changelog tooling can reliably categorise changes. + +on: + pull_request_target: + types: [opened, reopened, edited, synchronize] + +permissions: + pull-requests: read + +jobs: + lint: + name: Conventional Commit + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5c4bd60 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +# Build and attach artifacts when a version tag is pushed, then publish +# the draft release that release-drafter has already prepared. + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + # Re-use the CI workflow so we don't duplicate build definitions. + ci: + uses: ./.github/workflows/ci.yml + permissions: + contents: read + + release: + name: Publish Release + runs-on: macos-15 + needs: [ci] + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + # Build everything from scratch (cleaner than downloading CI artifacts + # across jobs, and takes ~30s on macos-15 runners). + - name: Build CLI + run: make build-cli + + - name: Build Swift app + run: make build-swift + + - name: Assemble .app bundle + run: make build-app + + - name: Build DMG + run: make build-dmg + + # Zip the .app bundle so it survives upload as a single file. + - name: Package .app as zip + run: cd build && zip -r Graftery.app.zip Graftery.app + + # Upload artifacts to the release. softprops/action-gh-release will + # find the existing draft (created by release-drafter) for this tag, + # attach the files, and publish it. + - name: Upload release assets + uses: softprops/action-gh-release@v2 + with: + files: | + build/Graftery.dmg + build/Graftery.app.zip + build/graftery