Skip to content

Commit

Permalink
Merge pull request #396 from vscheuber/main
Browse files Browse the repository at this point in the history
update build node version to 18, update package-lock.json, audit dev dependencies, add node 22 and drop node 16 from test matrix, update npm-publish action to v3
  • Loading branch information
vscheuber committed Jun 20, 2024
2 parents 4b81953 + e2ec339 commit fae35f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update package-log.json
run: npm i --package-lock-only

- name: 'Version From Tag'
id: version-from-tag
run: echo "version=$(echo '${{ steps.version-bump.outputs.newTag }}' | sed 's/v//')" >> "$GITHUB_OUTPUT"
Expand All @@ -74,7 +77,7 @@ jobs:
run: npx tsc

- name: Security Audit
run: npm audit --omit=dev --audit-level high
run: npm audit --audit-level high

- uses: actions/upload-artifact@v4
with:
Expand All @@ -89,17 +92,17 @@ jobs:
newVersion: ${{ steps.version-from-tag.outputs.version }}
preRelease: ${{ contains(steps.version-bump.outputs.newTag, '-') }}

smoke-tests:
name: 'Smoke Tests'
test:
name: 'Test'
needs: build
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 18, 16]
node-version: [22, 20, 18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

# Service containers to run with `smoke-tests`
# Service containers to run with `test`
services:
# Label used to access the service container
squid:
Expand Down Expand Up @@ -258,15 +261,15 @@ jobs:

- name: Pre-Release
if: ${{ fromJSON(needs.build.outputs.preRelease) }}
uses: JS-DevTools/npm-publish@v1
uses: JS-DevTools/npm-publish@v3
with:
access: public
tag: 'next'
token: ${{ secrets.NPM_ACCESS_TOKEN }}

- name: Release
if: ${{ ! fromJSON(needs.build.outputs.preRelease) }}
uses: JS-DevTools/npm-publish@v1
uses: JS-DevTools/npm-publish@v3
with:
access: public
token: ${{ secrets.NPM_ACCESS_TOKEN }}
Expand Down Expand Up @@ -310,7 +313,7 @@ jobs:
macos-binary-release:
# don't run on PRs, since secrets are not available
if: github.event_name != 'pull_request'
needs: [build, smoke-tests]
needs: [build, test]
runs-on: macos-latest
timeout-minutes: 15
steps:
Expand Down Expand Up @@ -387,7 +390,7 @@ jobs:

linux-binary-release:
# run on PRs for e2e testing binary builds as linux builds do not require secrets.
needs: [build, smoke-tests]
needs: [build, test]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -425,7 +428,7 @@ jobs:
linux-arm64-binary-release:
# don't run on PRs to speed up the checks
if: github.event_name != 'pull_request'
needs: [build, smoke-tests]
needs: [build, test]
runs-on: self-hosted
steps:
- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -464,7 +467,7 @@ jobs:
windows-binary-release:
# don't run on PRs to speed up the checks
if: github.event_name != 'pull_request'
needs: [build, smoke-tests]
needs: [build, test]
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"build": "npm run build:binary",
"build:only": "npx tsup && npx tsc",
"build:binary": "npm run build:only && npm run dist-pkg",
"dist-pkg": "pkg -C Gzip -t node18 --config package.json -o frodo dist/app.cjs",
"dist-pkg": "pkg -C Gzip -t node20 --config package.json -o frodo dist/app.cjs",
"link": "npm link ../frodo-lib",
"dev": "npx tsup --watch src"
},
Expand Down

0 comments on commit fae35f6

Please sign in to comment.