ci: allow tests to run on any branch #17
Workflow file for this run
This file contains 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: Handle Release Branch Push | |
on: | |
push: | |
jobs: | |
verify: | |
name: CI | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
script: | |
# - name: Typecheck | |
# command: test:types | |
- name: Lint | |
command: test:lint | |
- name: Unit tests | |
command: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
- name: Install dependencies | |
run: npm ci --ignore-scripts --no-audit --no-fund | |
- name: Rebuild binaries | |
run: npm rebuild | |
- name: ${{ matrix.script.name }} | |
run: npm run ${{ matrix.script.command }} | |
publish: | |
name: Publish release | |
needs: | |
- verify | |
if: contains(fromJson('["refs/heads/alpha", "refs/heads/beta", "refs/heads/main"]'), github.ref) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Publish Release | |
uses: ./.github/actions/publish-release | |
with: | |
branchName: ${{ github.head_ref || github.ref_name }} | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
npmToken: ${{ secrets.NPM_TOKEN }} |