Skip to content

Commit

Permalink
ci: pack zeromq in the package stage
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 26, 2024
1 parent 1af6c6f commit d3f7a97
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,6 @@ jobs:
name: build-${{ strategy.job-index }}
overwrite: true

- name: Pack Zeromq
if: matrix.os == 'ubuntu-20.04'
run: |
pnpm run build.js
pnpm pack
- name: Upload Pack
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v4
with:
path: ./*.tgz
name: pack
overwrite: true

- name: Lint
if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
run: pnpm run lint-test
Expand All @@ -202,7 +188,7 @@ jobs:
xvfb-run --auto-servernum pnpm run test.electron.main
continue-on-error: true

MergeBuild:
Package:
runs-on: ubuntu-latest
needs: Build
steps:
Expand All @@ -213,9 +199,40 @@ jobs:
pattern: build-*
delete-merged: true

- run: |
ls -R
- uses: actions/checkout@v4

- name: Place build
uses: actions/download-artifact@v4
with:
name: build
path: ./build

- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: "./.nvmrc"

- name: Install Pnpm
uses: pnpm/action-setup@v4

- name: Pack Zeromq
run: |
pnpm install
pnpm pack
- name: Upload Pack
uses: actions/upload-artifact@v4
with:
path: ./*.tgz
name: pack
overwrite: true

SmokeTest:
runs-on: ${{ matrix.os }}
needs: MergeBuild
needs: Package
strategy:
fail-fast: false
matrix:
Expand All @@ -228,13 +245,7 @@ jobs:
- 10
- 22
steps:
- name: Place build
uses: actions/download-artifact@v4
with:
name: build
path: ./build

- name: Place Pack
- name: Download Pack
uses: actions/download-artifact@v4
with:
name: pack
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"lint": "run-p format lint.eslint format",
"lint-test": "run-s lint-test.eslint",
"bench": "node --expose-gc test/bench",
"prepublishOnly": "pnpm run build.js",
"bump": "pnpx npm-check-updates -u -x typescript,eslint,chai && pnpx typesync && pnpm update"
},
"cmake-ts": {
Expand Down
4 changes: 3 additions & 1 deletion script/smoke-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -ev
set -o pipefail

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

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

ls -R ./node_modules/zeromq

echo "Require zeromq"
node -e "console.log(require('zeromq'))"

Expand Down

0 comments on commit d3f7a97

Please sign in to comment.