Skip to content

update CI

update CI #20

Workflow file for this run

name: Node.js
on:
push:
branches: [ "main" ]
tags: [ '*' ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
node-version:
- 18.x # EOL: 2025-04-30
- 20.x # EOL: 2026-04-30
- 21.x # EOL: 2024-06-01
#- 22.x # REL: 2024-04-23 EOL: 2027-04-30
#- 23.x # REL: 2024-10-15 EOL: 2025-06-01
#- 24.x # REL: 2025-04-22 EOL: 2028-04-30
# See supported Node.js release schedule at https://github.com/nodejs/Release
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.js
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
check-latest: true
cache-dependency-path: ./getargv.js/package-lock.json
- run: npm ci
working-directory: getargv.js
- run: cat /Users/runner/.npm/_logs/*-debug.log && false
if: ${{ failure() }}
- run: npm run build --if-present
working-directory: getargv.js
- run: npm test
working-directory: getargv.js
- name: Build
run: |
npm ci
mkdir pkg
npm pack --pack-destination ./pkg/ || ( npm pack && mv camjn-getargv*.tgz ./pkg/ )
working-directory: getargv.js
- uses: actions/upload-artifact@v3
with:
name: pack-${{ matrix.node-version }}
path: getargv.js/pkg/*
release:
if: ${{ github.ref_type == 'tag' }}
needs: [ test ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
path: pkg
- uses: softprops/action-gh-release@v1
with:
files: pkg/pack-*/*
name: ${{ github.ref_name }}