pre_release.yaml•1.82 kB
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/wait-on-check-action@v1.3.4
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: false
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