Skip to content

chore(release): v1.3.0 #26

chore(release): v1.3.0

chore(release): v1.3.0 #26

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to publish to npm (e.g. 1.2.0, no leading v). Use this to (re)publish npm without re-running GoReleaser."
required: true
type: string
permissions:
contents: read
jobs:
goreleaser:
# Build binaries, create the GitHub release, and update the Homebrew cask.
# Runs only on a tag push; npm publishing is a separate job so an npm-side
# failure never blocks the GitHub release / Homebrew cask, and so npm can be
# (re)published independently via workflow_dispatch.
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Run tests
run: go test ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
publish-npm:
# Publishes the npm launcher. Runs after a successful GoReleaser on a tag
# push, and can also be triggered manually (workflow_dispatch) to publish or
# re-publish a specific version without re-running GoReleaser.
needs: [goreleaser]
if: ${{ always() && (github.event_name == 'workflow_dispatch' || needs.goreleaser.result == 'success') }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # enables npm provenance, and OIDC trusted publishing if configured
steps:
- uses: actions/checkout@v4
# Node >= 22.14 is required for OIDC trusted publishing.
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
# npm >= 11.5 is required for OIDC trusted publishing. Deliberately no
# registry-url / NODE_AUTH_TOKEN: a configured token (even an empty one)
# makes npm take the token auth path instead of OIDC. With none set, npm
# authenticates with the OIDC id-token against the trusted publisher
# configured on npmjs.com -- nothing to expire or rotate.
- name: Use latest npm
run: npm install -g npm@latest
- name: Resolve version
id: ver
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION="${GITHUB_REF_NAME}"
fi
echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
- name: Publish to npm (OIDC trusted publishing)
run: |
cd npm
npm version "${{ steps.ver.outputs.version }}" --no-git-tag-version
npm publish --provenance --access public