Repository navigation
Publish Package #4
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 Package | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write # npm trusted publishing (OIDC), no token | |
| contents: write # tag + GitHub release after a successful publish | |
| jobs: | |
| publish: | |
| if: github.repository == 'WaveSpeedAI/wavespeed-opencode' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm ci | |
| - run: npm run check | |
| - run: npm test | |
| - run: npm publish | |
| - name: Tag and create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| VERSION="v$(node -p "require('./package.json').version")" | |
| gh release view "$VERSION" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 && exit 0 | |
| gh release create "$VERSION" --repo "$GITHUB_REPOSITORY" --target "$GITHUB_SHA" --title "$VERSION" --generate-notes |