release.yml #10
Workflow file for this run
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
| # .github/workflows/release.yml | |
| name: release.yml | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| environment: release | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Check and Update npm | |
| run: | | |
| echo "Initial npm version:" | |
| npm --version | |
| npm install -g npm@latest | |
| echo "Updated npm version:" | |
| npm --version | |
| - name: Install dependencies and build | |
| run: | | |
| pnpm install | |
| pnpm run build | |
| - name: Publish to npm | |
| run: npm publish --provenance |