Skip to content

Commit 6e35a42

Browse files
committed
fix(CI): provide target on the fly
1 parent cbb0d68 commit 6e35a42

3 files changed

Lines changed: 5114 additions & 8189 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,69 +8,50 @@ jobs:
88
build:
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, windows-latest, macos-latest]
11+
include:
12+
- os: ubuntu-latest
13+
target: node18-linux-x64
14+
15+
- os: windows-latest
16+
target: node18-win-x64
17+
18+
- os: macos-latest
19+
target: node18-macos-arm64
1220

1321
runs-on: ${{ matrix.os }}
1422

1523
permissions:
1624
contents: write
1725

26+
env:
27+
PKG_TARGET: ${{ matrix.target }}
28+
1829
steps:
19-
# ----------------------------
20-
# Checkout
21-
# ----------------------------
2230
- uses: actions/checkout@v4
2331
with:
2432
fetch-depth: 0
2533

26-
# ----------------------------
27-
# Node setup
28-
# ----------------------------
2934
- uses: actions/setup-node@v4
3035
with:
3136
node-version: 20
3237
registry-url: https://registry.npmjs.org
3338
cache: npm
3439

35-
# ----------------------------
36-
# Install deps
37-
# ----------------------------
3840
- run: npm ci
3941

40-
# ----------------------------
41-
# Build project
42-
# ----------------------------
42+
# IMPORTANT for wrtc native binaries
43+
- run: npm rebuild @roamhq/wrtc
44+
4345
- run: npm run build
4446

45-
# ----------------------------
46-
# Build server (pkg)
47-
# ----------------------------
48-
- run: npm run pkg:server
47+
- run: npm run pkg
4948

50-
# ----------------------------
51-
# macOS signing (ONLY macOS)
52-
# ----------------------------
49+
# macOS ad-hoc signing
5350
- name: Codesign macOS binary
5451
if: matrix.os == 'macos-latest'
5552
run: |
56-
echo "Signing macOS server binary..."
57-
codesign --force --deep --sign - ./dist/server/wsc-server-macos-arm64
58-
59-
echo "Verifying signature..."
60-
codesign --verify --deep --strict --verbose=2 ./dist/server/wsc-server-macos-arm64
53+
find ./implementations/js/server/dist/bin -type f -exec codesign --force --deep --sign - {} \;
6154
62-
# ----------------------------
63-
# Upload artifacts
64-
# ----------------------------
65-
- name: Upload build artifacts
66-
uses: actions/upload-artifact@v4
67-
with:
68-
name: server-${{ matrix.os }}
69-
path: dist/
70-
71-
# ----------------------------
72-
# Release (runs once)
73-
# ----------------------------
7455
release:
7556
needs: build
7657
runs-on: ubuntu-latest
@@ -80,8 +61,6 @@ jobs:
8061

8162
steps:
8263
- uses: actions/checkout@v4
83-
with:
84-
fetch-depth: 0
8564

8665
- uses: actions/setup-node@v4
8766
with:

implementations/js/server/package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
"no-bytecode": true,
2626
"public-packages": "*"
2727
},
28-
"targets": [
29-
"node18-macos-x64",
30-
"node18-linux-x64",
31-
"node18-windows-x64",
32-
"node18-macos-arm64",
33-
"node18-linux-arm64",
34-
"node18-windows-arm64"
35-
],
3628
"outputPath": "./dist/bin"
3729
},
3830
"main": "./dist/main.cjs",
@@ -48,7 +40,7 @@
4840
"dev": "tsx watch ./src/main.js",
4941
"start": "node ./dist/main.cjs",
5042
"build": "node ./src/scripts/build.js",
51-
"pkg": "npm run build; npx pkg ."
43+
"pkg": "npm run build && pkg . --targets $PKG_TARGET"
5244
},
5345
"author": "Timé Kadel",
5446
"license": "GPL-3.0-only",

0 commit comments

Comments
 (0)