Release v0.13.0 #27
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: | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6 | |
| with: | |
| go-version: '1.26' | |
| - name: Install cross-compilation toolchains | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-aarch64-linux-gnu | |
| - name: Reject replace directives in go.mod | |
| run: | | |
| if grep -qE '^replace\s' go.mod; then | |
| echo "ERROR: go.mod contains replace directives — aborting release." | |
| echo "Replace directives break 'go install ...@latest'." | |
| echo "See: https://github.com/steveyegge/gastown/issues/2230" | |
| grep -n '^replace' go.mod | |
| exit 1 | |
| fi | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7 | |
| with: | |
| distribution: goreleaser | |
| version: '~> v2' | |
| args: > | |
| release --clean | |
| ${{ github.repository != 'steveyegge/gastown' && '--skip=publish --skip=announce' || '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| needs: goreleaser | |
| if: ${{ github.repository == 'steveyegge/gastown' }} | |
| # npm publish is best-effort — don't fail the release if npm is down or | |
| # the @gastown org isn't set up yet. GoReleaser + Homebrew are the primary | |
| # distribution channels. | |
| continue-on-error: true | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC token for npm trusted publishing (no NPM_TOKEN needed) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Update npm for provenance support | |
| run: npm install -g npm@latest | |
| - name: Publish to npm | |
| run: | | |
| cd npm-package | |
| npm publish --access public --provenance |