| 1 | name: Release |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | |
| 8 | concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 9 | |
| 10 | permissions: # added using https://github.com/step-security/secure-repo |
| 11 | contents: read |
| 12 | |
| 13 | jobs: |
| 14 | release: |
| 15 | if: github.repository == 'mermaid-js/mermaid' |
| 16 | permissions: |
| 17 | contents: write # to create release (changesets/action) |
| 18 | id-token: write # OpenID Connect token needed for provenance |
| 19 | pull-requests: write # to create pull request (changesets/action) |
| 20 | name: Release |
| 21 | runs-on: ubuntu-latest |
| 22 | steps: |
| 23 | - name: Checkout Repo |
| 24 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 25 | |
| 26 | - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 |
| 27 | |
| 28 | - name: Setup Node.js |
| 29 | uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 |
| 30 | with: |
| 31 | cache: pnpm |
| 32 | node-version-file: '.node-version' |
| 33 | |
| 34 | - name: Install Packages |
| 35 | run: | |
| 36 | pnpm install --frozen-lockfile |
| 37 | npm install -g npm@11 |
| 38 | |
| 39 | - name: Create Release Pull Request or Publish to npm |
| 40 | id: changesets |
| 41 | uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10 |
| 42 | with: |
| 43 | version: pnpm changeset:version |
| 44 | publish: pnpm changeset:publish |
| 45 | env: |
| 46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | NPM_CONFIG_PROVENANCE: true |
| 48 | |