update CI workflow to install production dependencies and adjust buil… #2
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: Publish (OIDC) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - published | |
| concurrency: | |
| group: npm-publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org | |
| cache: pnpm | |
| - name: Install | |
| run: pnpm -w install --frozen-lockfile --prod=false | |
| - name: Set version (@next) | |
| if: github.event_name == 'push' | |
| run: node ./scripts/set-next-version.mjs | |
| - name: Set version (release tag) | |
| if: github.event_name == 'release' | |
| env: | |
| RELEASE_TAG: ${{ github.event.release.tag_name }} | |
| run: node ./scripts/set-release-version.mjs | |
| - name: Build core | |
| run: pnpm -C packages/core build | |
| - name: Publish @next | |
| if: github.event_name == 'push' | |
| working-directory: packages/core | |
| run: npm publish --tag next --access public --ignore-scripts | |
| - name: Publish release | |
| if: github.event_name == 'release' | |
| working-directory: packages/core | |
| run: npm publish --access public --ignore-scripts | |