| 1 | name: Preview release |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | branches: [develop] |
| 6 | types: [opened, synchronize, labeled, ready_for_review] |
| 7 | |
| 8 | concurrency: |
| 9 | group: ${{ github.workflow }}-${{ github.event.number }} |
| 10 | cancel-in-progress: true |
| 11 | |
| 12 | permissions: |
| 13 | contents: read |
| 14 | actions: write |
| 15 | |
| 16 | jobs: |
| 17 | preview: |
| 18 | if: ${{ github.repository_owner == 'mermaid-js' }} |
| 19 | runs-on: ubuntu-latest |
| 20 | permissions: |
| 21 | contents: read |
| 22 | id-token: write |
| 23 | issues: write |
| 24 | pull-requests: write |
| 25 | name: Publish preview release |
| 26 | timeout-minutes: 5 |
| 27 | steps: |
| 28 | - name: Checkout Repo |
| 29 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 30 | |
| 31 | - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 |
| 32 | |
| 33 | - name: Setup Node.js |
| 34 | uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 |
| 35 | with: |
| 36 | cache: pnpm |
| 37 | node-version-file: '.node-version' |
| 38 | |
| 39 | - name: Install Packages |
| 40 | run: pnpm install --frozen-lockfile |
| 41 | |
| 42 | - name: Publish packages |
| 43 | run: pnpx pkg-pr-new publish --pnpm './packages/*' |
| 44 | |