0.8.0 #87
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: | |
| branches: [ $default-branch, main ] | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| setup: | |
| name: Setup environment | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Cache node_modules | |
| id: cache-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies | |
| if: steps.cache-modules.outputs.cache-hit != 'true' | |
| run: npm ci | |
| test: | |
| name: Test | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Load node_modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }} | |
| - name: Unit tests | |
| run: npm test | |
| - name: Linter | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Cache dist | |
| uses: actions/cache@v4 | |
| with: | |
| path: dist/ | |
| key: ${{ runner.os }}-dist-${{ github.sha }} | |
| publish: | |
| if: github.event_name == 'push' && contains(github.ref, '/tags/v') | |
| name: Publish to npm | |
| needs: test | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Load node_modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }} | |
| - name: Load dist from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: dist/ | |
| key: ${{ runner.os }}-dist-${{ github.sha }} | |
| - name: Create npmrc file | |
| run: echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" >> $HOME/.npmrc 2> /dev/null | |
| - run: npm publish | |
| release: | |
| if: github.event_name == 'push' && contains(github.ref, '/tags/v') | |
| name: Github release | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Load node_modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }} | |
| - name: Extract tmp current changelog | |
| run: node utils/extractChangelog.mjs | |
| - name: Create release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: current-changelog.txt |