fix: improve beta release cicd #174
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: Create a pre-release | |
| on: | |
| # Only trigger on PRs with "beta" label | |
| pull_request: | |
| types: [labeled, synchronize, reopened] | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| wait_for_checks: | |
| # Run ONLY when PR has the "beta" label | |
| if: contains(github.event.pull_request.labels.*.name, 'beta') | |
| name: Wait for code checks to pass | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Wait for existing checks or skip if none | |
| uses: lewagon/[email protected] | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| check-regexp: (Code checks) | |
| wait-interval: 10 | |
| running-workflow-name: 'Wait for code checks to pass' | |
| allowed-conclusions: success,neutral,skipped | |
| continue-on-error: true | |
| - name: Run checks if none were found | |
| if: failure() | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 22 | |
| if: failure() | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| - name: Install Dependencies | |
| if: failure() | |
| run: npm ci | |
| - name: Lint | |
| if: failure() | |
| run: npm run lint | |
| - name: Build | |
| if: failure() | |
| run: npm run build | |
| - name: Test | |
| if: failure() | |
| run: npm run test | |
| - name: Type checks | |
| if: failure() | |
| run: npm run type-check | |
| push_pkg_pr_new: | |
| needs: [ wait_for_checks ] | |
| name: Push to pkg.pr.new | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - run: npx -y pkg-pr-new publish |