Skip to content

Commit

Permalink
ci: migrate from travis to github actions
Browse files Browse the repository at this point in the history
- chore: declare packageManager yarn in manifest
  • Loading branch information
legobeat committed Oct 2, 2024
1 parent c753c81 commit 37bd039
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Node CI

on: [push]
env:
FORCE_COLOR: 2
jobs:
test:
name: v${{ matrix.node }} @ ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node:
- 8
- 10
- 12
- 14
- 16
- 18
- 20
- 22
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
cache: ''
- run: npm config --global set spin false
if: '${{ matrix.node < 18 }}'
- run: yarn install --frozen-lockfile
- run: yarn run test
22 changes: 22 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish package to npm
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: ''
- run: yarn install --frozen-lockfile
- run: yarn run test
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"uglify-js": "2.4.x"
},
"optionalDependencies": {},
"packageManager": "[email protected]",
"engines": {
"node": "8.* || >= 10.*"
}
Expand Down

0 comments on commit 37bd039

Please sign in to comment.