Skip to content

Commit

Permalink
ci: improve overall
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Aug 18, 2023
1 parent 4ebfecf commit 6fd924e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 23 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@ on:
- v3

jobs:
publish:
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/[email protected]
- name: Get Node version from Node manifest
run: |
echo "NODE_VER=$(jq -r '.engines.node' package.json | sed 's/v//' )" >> $GITHUB_ENV
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 18
node-version: ${{ env.NODE_VER }}
cache: "npm"

- run: npm ci
- uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
tag: stable
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: npm ci
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
tag: stable
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ concurrency:
cancel-in-progress: true

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [14, 16, 18]
runs-on: ${{ matrix.os }}
e2e:
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v1
- name: Checkout repository
uses: actions/[email protected]
- name: Get Node version from Node manifest
run: |
echo "NODE_VER=$(jq -r '.engines.node' package.json | sed 's/v//' )" >> $GITHUB_ENV
- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
npm-version: '8.5.0'
- run: npm ci
- run: npm run format
- run: npm run lint
- run: npm run test
node-version: ${{ env.NODE_VER }}
cache: "npm"
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: npm ci
- name: Run test
run: npm test
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"winresourcer": "^0.9.0",
"yargs": "^17.5.1"
},
"engines": {
"node": "v20.5.0"
},
"packageManager": "[email protected]",
"bin": {
"nwbuild": "./bin/nwbuild.cjs"
},
Expand Down

0 comments on commit 6fd924e

Please sign in to comment.