Version or Publish #181
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: Version or Publish | |
| on: | |
| workflow_run: | |
| workflows: ["Builds, tests & co"] | |
| types: [completed] | |
| concurrency: ${{ github.workflow }} | |
| permissions: read-all | |
| jobs: | |
| release: | |
| if: ${{ github.event.workflow_run.head_branch == 'master' && github.event.workflow_run.conclusion == 'success' }} | |
| permissions: | |
| contents: write # to create release | |
| id-token: write # to generate provenance | |
| issues: write # to post issue comments | |
| pull-requests: write # to create pull request | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set-up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| check-latest: true | |
| node-version-file: .nvmrc | |
| registry-url: https://registry.npmjs.org | |
| - run: corepack enable | |
| - run: pnpm i | |
| - run: npm install -g npm@latest | |
| - name: Create Release Pull Request | |
| uses: changesets/action@v1 | |
| continue-on-error: false | |
| id: pub-or-release-pr | |
| with: | |
| version: pnpm changeset:version | |
| publish: pnpm pub | |
| createGithubReleases: false | |
| env: | |
| CI: true | |
| GITHUB_TOKEN: ${{ github.token }} |