Release #12
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*' | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| jobs: | ||
| lint: | ||
| uses: ./.github/workflows/lint.yml | ||
|
Check failure on line 14 in .github/workflows/release.yml
|
||
| test: | ||
| uses: ./.github/workflows/test.yml | ||
| publish: | ||
| name: Publish | ||
| needs: [lint, test] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "lts/*" | ||
| registry-url: "https://registry.npmjs.org" | ||
| - name: Install Node packages | ||
| run: npm ci | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Publish to npm | ||
| run: npm publish --provenance | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| - name: Generate release notes | ||
| uses: orhun/git-cliff-action@v4 | ||
| id: git-cliff | ||
| with: | ||
| config: cliff.toml | ||
| args: --latest --strip header | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| # TODO: Perhaps there is a simpler way to avoid the heading of each release | ||
| - name: Process release notes | ||
| id: process-notes | ||
| run: | | ||
| # Remove the first two lines (version heading and empty line) | ||
| cat << 'RELEASE_EOF' | tail -n +3 > release_notes.txt | ||
| ${{ steps.git-cliff.outputs.content }} | ||
| RELEASE_EOF | ||
| echo "content<<EOF" >> $GITHUB_OUTPUT | ||
| cat release_notes.txt >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| name: ${{ github.ref_name }} | ||
| body: ${{ steps.process-notes.outputs.content }} | ||