v0.6.0 #9
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
| # SPDX-License-Identifier: MIT | |
| # Copyright (c) PromptKit Contributors | |
| name: Publish to npm | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| name: Publish npm package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Sync version from release tag | |
| run: | | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION="${VERSION#v}" | |
| cd cli | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| - name: Install dependencies | |
| run: | | |
| cd cli | |
| npm ci | |
| - name: Bundle content | |
| run: | | |
| cd cli | |
| node scripts/copy-content.js | |
| - name: Verify package | |
| run: | | |
| cd cli | |
| node bin/cli.js --version | |
| node bin/cli.js list | |
| - name: Publish to npm | |
| run: | | |
| cd cli | |
| npm publish --provenance --access public |