fix: CI perms #176
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: "Build and Publish" | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PR_TITLE: "Create Release" | |
COMMIT_MSG: "chore: create new release" | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.x] | |
permissions: | |
contents: read | |
id-token: write # The OIDC ID token is used for authentication with JSR | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build-all | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
retention-days: 2 | |
- name: Create release or publish package | |
uses: changesets/action@v1 | |
id: changesets | |
with: | |
publish: npm run publish-package | |
commit: ${{ env.COMMIT_MSG }} | |
title: ${{ env.PR_TITLE }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |