|
| 1 | +name: Publish Packages |
| 2 | + |
| 3 | +on: workflow_dispatch |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + |
| 8 | +jobs: |
| 9 | + checks: |
| 10 | + uses: ./.github/workflows/checks.yml |
| 11 | + secrets: inherit |
| 12 | + |
| 13 | + unit_tests: |
| 14 | + uses: ./.github/workflows/unit-tests.yml |
| 15 | + secrets: inherit |
| 16 | + |
| 17 | + release: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: write # to be able to publish a GitHub release |
| 21 | + issues: write # to be able to comment on released issues |
| 22 | + id-token: write # to enable use of OIDC for npm provenance |
| 23 | + attestations: write # necessary to persist the attestation |
| 24 | + needs: [checks, unit_tests] |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Install pnpm |
| 30 | + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda |
| 31 | + |
| 32 | + - name: Setup node |
| 33 | + uses: actions/setup-node@v4 |
| 34 | + with: |
| 35 | + node-version-file: .nvmrc |
| 36 | + cache: pnpm |
| 37 | + |
| 38 | + - name: Install Dependencies |
| 39 | + run: pnpm install --frozen-lockfile --ignore-scripts |
| 40 | + |
| 41 | + # - name: Configure .npmrc |
| 42 | + # run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc |
| 43 | + |
| 44 | + - name: Bump version, add tag, and publish github release |
| 45 | + env: |
| 46 | + BRANCH: ${{github.ref_name}} |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 49 | + NPM_CONFIG_PROVENANCE: true |
| 50 | + run: pnpm recursive run release |
| 51 | + |
| 52 | + - name: Remove node_modules |
| 53 | + run: | |
| 54 | + rm -rf packages/**/node_modules/ |
| 55 | +
|
| 56 | + - uses: actions/attest-build-provenance@v3 |
| 57 | + with: |
| 58 | + subject-path: packages |
0 commit comments