chore: add node setup and npm login in ci workflow #6
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
| name: CI | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| # pull_request: | |
| # types: [closed] | |
| # branches: | |
| # - main | |
| permissions: | |
| id-token: write #for OIDC | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: 'ubuntu-latest' | |
| # if: ${{github.event.pull_request.merged}} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - 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@v2 | |
| with: | |
| bun-version: 1.2.22 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Configure name and email | |
| run: | | |
| git config user.name ${{secrets.GH_USERNAME}} | |
| git config user.email ${{secrets.GH_EMAIL}} | |
| # commit message should include a valid tag | |
| # for pushing with tags use --follow-tags | |
| - name: Bump app version as per the tag | |
| run: bun pm version from-git | |
| - name: Publish to npm using OIDC | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |