Skip to content

Commit f1bbbb5

Browse files
committed
ci: pack zeromq in the package stage
1 parent 1af6c6f commit f1bbbb5

File tree

4 files changed

+39
-24
lines changed

4 files changed

+39
-24
lines changed

.github/workflows/CI.yml

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,6 @@ jobs:
162162
name: build-${{ strategy.job-index }}
163163
overwrite: true
164164

165-
- name: Pack Zeromq
166-
if: matrix.os == 'ubuntu-20.04'
167-
run: |
168-
pnpm run build.js
169-
pnpm pack
170-
171-
- name: Upload Pack
172-
if: matrix.os == 'ubuntu-20.04'
173-
uses: actions/upload-artifact@v4
174-
with:
175-
path: ./*.tgz
176-
name: pack
177-
overwrite: true
178-
179165
- name: Lint
180166
if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
181167
run: pnpm run lint-test
@@ -202,7 +188,7 @@ jobs:
202188
xvfb-run --auto-servernum pnpm run test.electron.main
203189
continue-on-error: true
204190

205-
MergeBuild:
191+
Package:
206192
runs-on: ubuntu-latest
207193
needs: Build
208194
steps:
@@ -213,9 +199,40 @@ jobs:
213199
pattern: build-*
214200
delete-merged: true
215201

202+
- run: |
203+
ls -R
204+
205+
- uses: actions/checkout@v4
206+
207+
- name: Place build
208+
uses: actions/download-artifact@v4
209+
with:
210+
name: build
211+
path: ./build
212+
213+
- name: Install Node
214+
uses: actions/setup-node@v4
215+
with:
216+
node-version-file: "./.nvmrc"
217+
218+
- name: Install Pnpm
219+
uses: pnpm/action-setup@v4
220+
221+
- name: Pack Zeromq
222+
run: |
223+
pnpm install
224+
pnpm pack
225+
226+
- name: Upload Pack
227+
uses: actions/upload-artifact@v4
228+
with:
229+
path: ./*.tgz
230+
name: pack
231+
overwrite: true
232+
216233
SmokeTest:
217234
runs-on: ${{ matrix.os }}
218-
needs: MergeBuild
235+
needs: Package
219236
strategy:
220237
fail-fast: false
221238
matrix:
@@ -228,13 +245,7 @@ jobs:
228245
- 10
229246
- 22
230247
steps:
231-
- name: Place build
232-
uses: actions/download-artifact@v4
233-
with:
234-
name: build
235-
path: ./build
236-
237-
- name: Place Pack
248+
- name: Download Pack
238249
uses: actions/download-artifact@v4
239250
with:
240251
name: pack

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.10.0

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"lint": "run-p format lint.eslint format",
113113
"lint-test": "run-s lint-test.eslint",
114114
"bench": "node --expose-gc test/bench",
115+
"prepublishOnly": "pnpm run build.js",
115116
"bump": "pnpx npm-check-updates -u -x typescript,eslint,chai && pnpx typesync && pnpm update"
116117
},
117118
"cmake-ts": {

script/smoke-test.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -ev
33
set -o pipefail
44

55
echo "Pack zeromq.js if needed"
6-
version=$(npm pkg get version | tr -d '"')
6+
version=$(node -e 'console.log(require("./package.json").version)')
77
pack_name="zeromq-${version}.tgz"
88
test -f "${pack_name}" || npm pack
99

@@ -26,6 +26,8 @@ for pm in "${package_managers[@]}"; do
2626
echo "Install with ${pm}"
2727
${pm} install
2828

29+
ls -R ./node_modules/zeromq
30+
2931
echo "Require zeromq"
3032
node -e "console.log(require('zeromq'))"
3133

0 commit comments

Comments
 (0)