chore: release v2.0.0 #7
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: {} | |
| jobs: | |
| release: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| environment: npm-registry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: setup pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: setup node | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| registry-url: "https://registry.npmjs.org" | |
| node-version: lts/* | |
| - name: update npm (oidc) | |
| run: npm install -g npm@latest | |
| - name: generate changelog | |
| run: pnpx changelogithub | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: build | |
| run: pnpm build | |
| - name: detect tag | |
| id: tag | |
| run: | | |
| LATEST_TAG=$(git describe --tags --abbrev=0) | |
| if [[ "$LATEST_TAG" == *-* ]]; then | |
| echo "tag=next" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: publish to npm | |
| run: pnpm publish --tag $TAG --access public --no-git-checks | |
| env: | |
| TAG: ${{ steps.tag.outputs.tag }} | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: publish to jsr | |
| run: npx jsr publish --allow-dirty | |
| - name: print dirty files | |
| run: git status --porcelain |