Define "files" to exclude unneeded files in package #78
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: ci | |
on: | |
push: | |
branches: | |
- main | |
tags: # To trigger the canary | |
- '*' | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
BRITTLE_TIMEOUT: 60000 | |
jobs: | |
test: | |
if: ${{ !startsWith(github.ref, 'refs/tags/')}} # Already runs for the push of the commit, no need to run again for the tag | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [lts/*] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1 | |
- name: install node | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 https://github.com/actions/setup-node/releases/tag/v3.8.2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://npm.pkg.github.com' | |
- run: npm install | |
- run: npm test | |
trigger_canary: | |
if: startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed) | |
runs-on: ubuntu-latest | |
steps: | |
- name: trigger canary | |
run: | | |
curl -L -X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.CANARY_DISPATCH_PAT }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/holepunchto/canary-tests/dispatches \ | |
-d '{"event_type":"triggered-by-${{ github.event.repository.name }}-${{ github.ref_name }}"}' |