Skip to content

Commit ffcc4ee

Browse files
committed
feat: drop support for Node < 24 and modernize CI workflows
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
1 parent 9a6aaec commit ffcc4ee

5 files changed

Lines changed: 49 additions & 108 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -25,81 +25,31 @@ jobs:
2525
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2626
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
2727
with:
28-
node-version: 24
28+
node-version: 26
2929
registry-url: https://registry.npmjs.org/
3030
package-manager-cache: false
3131

32-
- name: Setup git
32+
- name: Bump and push version
3333
if: inputs.upgrade != 'existing'
3434
run: |-
3535
git config --global user.name "github-actions[bot]"
3636
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
37-
38-
- name: Bump version
39-
if: inputs.upgrade != 'existing'
40-
run: npm version ${{ inputs.upgrade }}
41-
42-
- name: Push version
43-
if: inputs.upgrade != 'existing'
44-
run: |-
45-
git push
46-
git push --tags
37+
npm version ${{ inputs.upgrade }} -m "chore: release %s"
38+
git push --follow-tags
4739
4840
- run: npm publish
4941

50-
- name: Prepare build
51-
run: npm i -g pkg
52-
53-
- name: Build
54-
run: pkg --out-path build .
55-
56-
- name: Get version and package name
57-
id: get_info
42+
- name: Build and create release
43+
env:
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5845
run: |-
59-
version=$(node -p "require('./package.json').version")
60-
echo $version
61-
echo "::set-output name=version::$version"
6246
name=$(node -p "require('./package.json').name")
63-
echo $name
64-
echo "::set-output name=name::$name"
65-
66-
- name: Create Release
67-
id: create_release
68-
uses: actions/create-release@v1
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
with:
72-
tag_name: v${{ steps.get_info.outputs.version }}
73-
release_name: Release v${{ steps.get_info.outputs.version }}
74-
draft: false
75-
prerelease: false
76-
77-
- name: Upload Linux Binary
78-
uses: actions/upload-release-asset@v1
79-
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81-
with:
82-
upload_url: ${{ steps.create_release.outputs.upload_url }}
83-
asset_path: ./build/${{ steps.get_info.outputs.name }}-linux
84-
asset_name: ${{ steps.get_info.outputs.name }}-linux
85-
asset_content_type: application/x-executable
86-
87-
- name: Upload MacOS Binary
88-
uses: actions/upload-release-asset@v1
89-
env:
90-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91-
with:
92-
upload_url: ${{ steps.create_release.outputs.upload_url }}
93-
asset_path: ./build/${{ steps.get_info.outputs.name }}-macos
94-
asset_name: ${{ steps.get_info.outputs.name }}-macos
95-
asset_content_type: application/x-mach-binary
96-
97-
- name: Upload Windows Binary
98-
uses: actions/upload-release-asset@v1
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
with:
102-
upload_url: ${{ steps.create_release.outputs.upload_url }}
103-
asset_path: ./build/${{ steps.get_info.outputs.name }}-win.exe
104-
asset_name: ${{ steps.get_info.outputs.name }}-win.exe
105-
asset_content_type: application/x-dosexec
47+
version=$(node -p "require('./package.json').version")
48+
npm i -g pkg
49+
pkg --out-path build .
50+
gh release create "v$version" \
51+
--title "Release v$version" \
52+
--notes "Release v$version" \
53+
"./build/$name-linux" \
54+
"./build/$name-macos" \
55+
"./build/$name-win.exe"

.github/workflows/stale.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: "Stale"
22
on:
33
schedule:
4-
- cron: "0 0 * * *"
4+
- cron: "0 0 * * *"
5+
6+
permissions:
7+
contents: write
8+
issues: write
9+
pull-requests: write
510

611
jobs:
712
stale:
813
runs-on: ubuntu-latest
914
steps:
10-
- uses: actions/stale@v3
15+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
1116
with:
12-
repo-token: ${{ secrets.GITHUB_TOKEN }}
13-
stale-issue-message: "Marked as stale for no activity in the past 60 days. In 7 days it will be closed unless new activity."
14-
stale-pr-message: "Marked as stale for no activity in the past 60 days. In 7 days it will be closed unless new activity."
15-
exempt-issue-labels: "no-stale"
16-
exempt-pr-labels: "no-stale"
17+
delete-branch: true

.github/workflows/test.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,37 @@
11
name: Test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
8+
concurrency:
9+
group: test-${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
414

515
jobs:
616
test:
717
name: Test
818
runs-on: ${{ matrix.os }}
919

1020
strategy:
21+
fail-fast: false
1122
matrix:
1223
os: [ubuntu-latest, macOS-latest]
13-
node: [18, 20]
24+
node: [24, 26]
1425

15-
steps:
16-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17-
- name: Use Node.js ${{matrix.node}}
18-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
19-
with:
20-
node-version: ${{ matrix.node }}
21-
- name: npm install and test
22-
run: |
23-
npm install
24-
npm test
25-
env:
26-
CI: true
27-
28-
coverage:
29-
name: Coverage (Coveralls)
30-
needs: test
31-
runs-on: ubuntu-latest
3226
steps:
3327
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3428
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
3529
with:
36-
node-version: 20
37-
- run: |
38-
npm install
39-
npm test
40-
env:
41-
CI: true
42-
- name: Coveralls
43-
if: success()
44-
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
30+
node-version: ${{ matrix.node }}
31+
- run: npm ci
32+
- run: npm test
33+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
34+
if: matrix.os == 'ubuntu-latest' && matrix.node == 26
4535
with:
46-
github-token: ${{secrets.GITHUB_TOKEN}}
36+
name: coverage-report
37+
path: coverage/lcov.info

index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
const path = require("path")
44
const fs = require("fs")
55
const http = require("http")
6-
// spdy allows http2, while waiting express to support the http2 module
7-
const https = process.env.NODE_ENV === "production"
8-
? require("spdy")
9-
: require("https")
6+
const https = require("https")
107
const express = require("express")
118
const cors = require("cors")
129
const getCerts = require(path.resolve(__dirname, "certs.js")).getCerts

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "4.7.2",
44
"description": "HTTPS server running on localhost",
55
"main": "index.js",
6+
"engines": {
7+
"node": ">=24"
8+
},
69
"scripts": {
710
"pretest": "eslint --ignore-path .gitignore .",
811
"test": "node node_modules/nyc/bin/nyc.js node_modules/mocha/bin/_mocha --exit",
@@ -46,8 +49,7 @@
4649
"compression": "^1.7.4",
4750
"cors": "^2.8.5",
4851
"express": "^4.17.1",
49-
"uglify-js": "^3.15.1",
50-
"spdy": "^4.0.2"
52+
"uglify-js": "^3.15.1"
5153
},
5254
"devDependencies": {
5355
"eslint": "^7.25.0",

0 commit comments

Comments
 (0)