Merge pull request #14 from sovereignbase/release-please--branches--m… #44
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: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| HUSKY: 0 | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22.x, 24.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.10 | |
| - name: Set up Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.2.5 | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps | |
| - name: Run tests | |
| run: npm test | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage/lcov.info | |
| fail_ci_if_error: true | |
| - name: Enforce formatting | |
| run: | | |
| npm run format | |
| release-please: | |
| if: github.event_name == 'push' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| steps: | |
| - id: release | |
| uses: googleapis/release-please-action@v3 | |
| with: | |
| release-type: node | |
| package-name: '@sovereignbase/bytecodec' | |
| publish: | |
| if: needs.release-please.outputs.release_created == 'true' | |
| needs: release-please | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build --if-present | |
| - run: npm publish --access public --ignore-scripts | |
| - name: Sync jsr.json version from package.json | |
| run: | | |
| node -e "const fs=require('node:fs'); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); const jsr=JSON.parse(fs.readFileSync('jsr.json','utf8')); jsr.version=pkg.version; fs.writeFileSync('jsr.json', JSON.stringify(jsr, null, 2) + '\n');" | |
| - name: Publish to JSR | |
| run: npx jsr publish |