88 pull_request :
99 branches : [ master ]
1010
11+ permissions :
12+ contents : write # to allow workflow to publish release
13+
1114jobs :
1215 build :
1316 name : ${{ matrix.friendlyName }}
14- env :
15- CC : " clang"
16- CXX : " clang++"
17- npm_config_clang : " 1"
1817
1918 strategy :
2019 matrix :
21- node-version : [15 .x]
20+ node-version : [22 .x]
2221 os : [ubuntu-20.04, windows-2019, macos-latest]
2322 include :
2423 - os : ubuntu-20.04
@@ -31,11 +30,11 @@ jobs:
3130 runs-on : ${{ matrix.os }}
3231
3332 steps :
34- - uses : actions/checkout@v2
35- - name : Use Node.js ${{ matrix.node-version }}
36- uses : actions/setup-node@v1
33+ - uses : actions/checkout@v4
34+ - name : Install Node.js
35+ uses : actions/setup-node@v4
3736 with :
38- node-version : ${{ matrix .node-version }}
37+ node-version-file : ' .node-version'
3938 - run : |
4039 sudo apt-get install gnome-keyring \
4140 libsecret-1-dev \
4443 if: ${{ matrix.os == 'ubuntu-20.04' }}
4544 name: Install additional dependencies
4645
47- # This step can be removed as soon as official Windows arm64 builds are published:
48- # https://github.com/nodejs/build/issues/2450#issuecomment-705853342
49- - run : |
50- $NodeVersion = (node --version) -replace '^.'
51- $NodeFallbackVersion = "15.8.0"
52- & .\script\download-node-lib-win-arm64.ps1 $NodeVersion $NodeFallbackVersion
53- if: ${{ matrix.os == 'windows-2019' }}
54- name: Install Windows arm64 node.lib
55-
56- - run : npm install
46+ - run : npm ci
5747 name : Setup environment
5848
5949 - run : npm run build
9383 docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-napi-ia32 && rm -rf build"
9484 docker build -t node-keytar/arm64-cross-compile docker/arm64-cross-compile
9585 docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-arm64 && rm -rf build"
86+ docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-arm && rm -rf build"
9687 docker build -t node-keytar/armv7l-cross-compile docker/armv7l-cross-compile
9788 docker run --rm -v ${PWD}:/project node-keytar/armv7l-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-armv7l"
9889 if: ${{ matrix.os == 'ubuntu-20.04' }}
@@ -103,37 +94,34 @@ jobs:
10394 name: List prebuilds
10495
10596 - name : Upload prebuilds to GitHub
106- run : npm run upload
97+ run : npx prebuild --verbose -- upload-all ${{ secrets.GITHUB_TOKEN }}
10798 if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
108- env :
109- GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11099
111100 alpine-build :
112101 runs-on : ubuntu-latest
113- container : node:15 -alpine3.12
102+ container : node:22 -alpine3.20
114103 steps :
115- - uses : actions/checkout@v2
104+ - uses : actions/checkout@v4
116105 - name : install additional dependencies
117106 run : |
118- apk add g++ make python2 libsecret-dev
107+ apk add g++ make python3 libsecret-dev
119108
120- - run : npm install
109+ - run : npm ci
121110 name : Setup environment
122111
123112 - run : |
124113 npm run prebuild-napi-x64
125114 npm run prebuild-napi-arm64
115+ npm run prebuild-napi-arm
126116 name: Prebuild
127117
128118 - run : |
129119 ls prebuilds/
130120 name: List prebuilds
131121
132122 - name : Upload prebuilds to GitHub
133- run : npm run upload
123+ run : npx prebuild --verbose -- upload-all ${{ secrets.GITHUB_TOKEN }}
134124 if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
135- env :
136- GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
137125
138126 # Separate step for publishing to NPM so we're sure that generating + uploading prebuilds worked on all platforms
139127 npm-publish :
@@ -143,17 +131,17 @@ jobs:
143131 if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
144132
145133 steps :
146- - uses : actions/checkout@v2
147- - name : Use Node.js 15
148- uses : actions/setup-node@v1
134+ - uses : actions/checkout@v4
135+ - name : Install NodeJS
136+ uses : actions/setup-node@v4
149137 with :
150- node-version : 15.x
138+ node-version-file : ' .node-version '
151139 registry-url : ' https://registry.npmjs.org'
152140
153141 - run : sudo apt-get install libsecret-1-dev
154142 name : Install additional dependencies
155143
156- - run : npm install
144+ - run : npm ci
157145 name : Setup environment
158146
159147 - run : npm publish --access public
0 commit comments