chore(deps): update actions/setup-node action to v4 #124
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
# This is a Github Workflow that runs tests on any push or pull request. | |
# If the tests pass and this is a push to the master branch it also runs Semantic Release. | |
name: CI | |
on: [push, pull_request] | |
jobs: | |
init: | |
name: init | |
runs-on: ubuntu-22.04 | |
outputs: | |
skip: ${{ steps.ci-skip-step.outputs.ci-skip }} | |
skip-not: ${{ steps.ci-skip-step.outputs.ci-skip-not }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: ci-skip-step | |
uses: mstachniuk/ci-skip@v1 | |
test_push: | |
name: Test on push | |
needs: init | |
if: ${{ needs.init.outputs.skip == 'false' && github.event_name == 'push' }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install deps | |
run: npm i | |
- name: Run tests | |
run: npm run test | |
test_pr: | |
if: ${{ needs.init.outputs.skip == 'false' && github.event_name == 'pull_request' }} | |
needs: init | |
name: Test PR (Node v${{ matrix.node-version }}, OS ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
node-version: [ 16, 18 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install deps | |
run: npm i | |
- if: matrix.os == 'windows-2019' | |
run: npm i -g npm | |
- name: Run tests | |
timeout-minutes: 2 | |
run: npm test | |
release: | |
name: Release | |
# https://github.community/t/trigger-job-on-tag-push-only/18076 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
needs: test_push | |
runs-on: ubuntu-22.04 | |
permissions: | |
checks: read | |
statuses: write | |
contents: write | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: master | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install deps | |
run: npm i | |
- name: Create .npmrc | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc | |
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> .npmrc | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_COMMITTER_EMAIL: '[email protected]' | |
GIT_COMMITTER_NAME: 'qiwibot' | |
run: npm_config_yes=true npx zx-semrel | |
# run: | | |
# npm link | |
# zx-extra https://raw.githubusercontent.com/semrel-extra/zx-semrel/0df9ee72ccaddae156e821a340806d49307b963c/release.mjs |