fix: borked semantic release #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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened, edited ] | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| test: | |
| name: Test Node.js ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x, 22.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install just | |
| uses: extractions/setup-just@v2 | |
| - name: Install dependencies | |
| run: just install | |
| - name: Run type check | |
| run: just typecheck | |
| - name: Run linter | |
| run: just lint | |
| - name: Run tests with coverage | |
| run: just test-coverage | |
| - name: Upload coverage to Codecov | |
| if: matrix.node-version == '20.x' && github.repository == 'jacobboykin/amazing-marvin-client-js' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| continue-on-error: true | |
| - name: Build project | |
| run: just build | |
| - name: Test package installation | |
| if: matrix.node-version == '20.x' | |
| run: | | |
| npm pack | |
| npm install -g ./jacobboykin-amazing-marvin-client-*.tgz | |
| node -e "console.log('Package installed successfully')" | |
| commitlint: | |
| name: Validate commit messages | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install just | |
| uses: extractions/setup-just@v2 | |
| - name: Install dependencies | |
| run: just install | |
| - name: Validate PR title | |
| run: echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose | |
| security: | |
| name: Security audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install just | |
| uses: extractions/setup-just@v2 | |
| - name: Install dependencies | |
| run: just install | |
| - name: Run security audit | |
| run: just audit | |
| - name: Check for known vulnerabilities | |
| run: npx audit-ci --config .audit-ci.json || true | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: [test, security] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@jacobboykin' | |
| - name: Install just | |
| uses: extractions/setup-just@v2 | |
| - name: Install dependencies | |
| run: just install | |
| - name: Run full CI pipeline | |
| run: just ci | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release |