diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 416005e..c1cd072 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,16 +1,24 @@ name: CI -on: [push] +on: + pull_request: + push: + branches: [ 'master' ] jobs: - Build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 14 - - name: Install dependencies - run: npm install - - name: Test - run: npm test + ci: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + node-version: [20, '${{ vars.NODE_VERSION }}' ] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm install + - name: Test + run: npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b66b300 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +name: Publish + +on: + release: + types: [created] + workflow_dispatch: + +env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version: ${{ vars.NODE_VERSION }} + registry-url: https://registry.npmjs.org/ + - name: Install Dependencies + run: npm ci + - name: Test + run: npm run test + - name: Publish + run: npm publish --access public