chore(package): use separate release config #317
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: main | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| jobs: | |
| build: | |
| name: Build and test | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| node-version: [18.x, 20.x, 22.x] | |
| runs-on: ${{ matrix.os }} | |
| 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: "yarn" | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build | |
| run: yarn build | |
| - name: Run tests | |
| run: yarn test:debug | |
| - name: Upload build artifacts (only on Node.js 22.x) | |
| if: matrix.node-version == '22.x' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: | | |
| es | |
| cjs | |
| coverage: | |
| name: Test coverage | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up latest Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: "yarn" | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run tests with coverage | |
| run: yarn test --coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| release: | |
| name: Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up latest Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: "yarn" | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run semantic release | |
| uses: cycjimmy/semantic-release-action@v4 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |