Merge pull request #7 from kernel/fix/use-admin-app-token #3
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: Version Bump | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| version-bump: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate app token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.ADMIN_APP_ID }} | |
| private-key: ${{ secrets.ADMIN_APP_PRIVATE_KEY }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for version bumping | |
| token: ${{ steps.app-token.outputs.token }} # Use app token to bypass branch protection | |
| - name: Setup Git | |
| run: | | |
| git config --global user.name 'kernel-internal[bot]' | |
| git config --global user.email '260533166+kernel-internal[bot]@users.noreply.github.com' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run linting | |
| run: bun run lint | |
| - name: Build | |
| run: bun run build | |
| - name: Bump version and push | |
| run: | | |
| # Bump version | |
| npm version patch -m "chore: bump version to %s [skip ci]" | |
| # Push directly to main | |
| git push origin HEAD:main --tags | |
| - name: Publish to NPM | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |