|
5 | 5 | branches: [main, staging] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - release: |
9 | | - runs-on: ubuntu-latest |
| 8 | + build: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 12 | + |
| 13 | + runs-on: ${{ matrix.os }} |
10 | 14 |
|
11 | 15 | permissions: |
12 | 16 | contents: write |
13 | 17 |
|
14 | 18 | steps: |
| 19 | + # ---------------------------- |
| 20 | + # Checkout |
| 21 | + # ---------------------------- |
15 | 22 | - uses: actions/checkout@v4 |
16 | 23 | with: |
17 | 24 | fetch-depth: 0 |
18 | 25 |
|
| 26 | + # ---------------------------- |
| 27 | + # Node setup |
| 28 | + # ---------------------------- |
19 | 29 | - uses: actions/setup-node@v4 |
20 | 30 | with: |
21 | 31 | node-version: 20 |
22 | 32 | registry-url: https://registry.npmjs.org |
| 33 | + cache: npm |
23 | 34 |
|
24 | | - - run: npm install |
| 35 | + # ---------------------------- |
| 36 | + # Install deps |
| 37 | + # ---------------------------- |
| 38 | + - run: npm ci |
25 | 39 |
|
| 40 | + # ---------------------------- |
| 41 | + # Build project |
| 42 | + # ---------------------------- |
26 | 43 | - run: npm run build |
27 | 44 |
|
| 45 | + # ---------------------------- |
| 46 | + # Build server (pkg) |
| 47 | + # ---------------------------- |
28 | 48 | - run: npm run pkg:server |
29 | 49 |
|
| 50 | + # ---------------------------- |
| 51 | + # macOS signing (ONLY macOS) |
| 52 | + # ---------------------------- |
| 53 | + - name: Codesign macOS binary |
| 54 | + if: matrix.os == 'macos-latest' |
| 55 | + 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 |
| 61 | +
|
| 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 | + # ---------------------------- |
| 74 | + release: |
| 75 | + needs: build |
| 76 | + runs-on: ubuntu-latest |
| 77 | + |
| 78 | + permissions: |
| 79 | + contents: write |
| 80 | + |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + with: |
| 84 | + fetch-depth: 0 |
| 85 | + |
| 86 | + - uses: actions/setup-node@v4 |
| 87 | + with: |
| 88 | + node-version: 20 |
| 89 | + |
| 90 | + - run: npm ci |
| 91 | + |
30 | 92 | - name: Release |
31 | 93 | run: npx semantic-release |
32 | 94 | env: |
|
0 commit comments