name: Release on: push: branches: [main] # GitHub sometimes drops a push event. A run started by hand releases the commits that push missed. workflow_dispatch: permissions: contents: read # Queued, never cancelled: a cancelled run could leave a tag without its npm version. concurrency: group: release cancel-in-progress: false jobs: release: name: Release to npm runs-on: macos-latest timeout-minutes: 15 environment: npm permissions: # semantic-release pushes the version tag and creates the GitHub release. contents: write # npm trusted publishing exchanges this OIDC token for a one-time publish credential and signs provenance. id-token: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # semantic-release reads every tag and the commits since the last one to pick the next version. fetch-depth: 0 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version-file: .node-version cache: npm - run: npm ci - run: npm run typecheck - run: npm run test:unit - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}