Release & Publish to NPM #25
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 & Publish to NPM | |
| on: workflow_dispatch | |
| # See https://docs.npmjs.com/trusted-publishers | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write # Required for creating tags and GitHub releases | |
| pull-requests: write # Required for changesets to create release PRs | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Initialize Git user | |
| run: | | |
| git config --global user.email "dev@contentpass.de" | |
| git config --global user.name "Release Workflow" | |
| - name: Lint, test, typecheck | |
| run: | | |
| yarn lint | |
| yarn test | |
| yarn typecheck | |
| yarn prettier:check | |
| - name: Build | |
| run: yarn build | |
| - name: Create release pull request or publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: yarn changeset:version | |
| publish: yarn changeset:publish | |
| title: "chore: version packages" | |
| commit: "chore: version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |