Release Please #13
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: Release Please | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Force release version (e.g., 1.2.3). Leave empty for automatic versioning." | |
| required: false | |
| type: string | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout (for force release) | |
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Force release version | |
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit --allow-empty -m "fix: force release ${{ github.event.inputs.version }}" -m "Release-As: ${{ github.event.inputs.version }}" | |
| git push | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup Bun | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: bun run build | |
| - name: Publish to npm | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: npm publish --provenance --access public |