@@ -4,10 +4,11 @@ on: workflow_dispatch
44
55jobs :
66 package :
7- runs-on : windows-latest
7+ runs-on : ${{ matrix.os }}
88
99 strategy :
1010 matrix :
11+ os : [ubuntu-22.04, macos-13, macos-13-xlarge, windows-2022]
1112 version : [
1213 { node: 22.18.0, electron: 38.0.0, openssl: 1.1.1w }
1314 ]
2223 node-version : ${{ matrix.version.node }}
2324 cache : ' npm'
2425
25- - name : Setup
26+ - uses : actions/setup-python@v5
27+ with :
28+ python-version : " 3.11"
29+
30+ - name : Setup (linux)
31+ if : matrix.os == 'ubuntu-22.04'
32+ run : |
33+ sudo apt-get update
34+ sudo apt-get install -y software-properties-common git build-essential clang libssl-dev libkrb5-dev libc++-dev wget zlib1g-dev
35+ echo "npm_config_openssl_dir=${{ github.workspace }}/openssl-${{ matrix.version.openssl }}/build" >> "$GITHUB_ENV"
36+
37+ - name : Cache Openssl (linux)
38+ if : matrix.os == 'ubuntu-22.04'
39+ id : cache-openssl
40+ uses : actions/cache@v4
41+ with :
42+ path : openssl-${{ matrix.version.openssl }}
43+ key : ${{ runner.os }}-openssl-${{ matrix.version.openssl }}
44+
45+ - name : Build Openssl (linux)
46+ if : matrix.os == 'ubuntu-22.04' && steps.cache-openssl.outputs.cache-hit != 'true'
47+ run : |
48+ wget -qO- https://www.openssl.org/source/openssl-${{ matrix.version.openssl }}.tar.gz | tar -xz
49+ cd openssl-${{ matrix.version.openssl }}
50+ ./config --prefix=${{ github.workspace }}/openssl-${{ matrix.version.openssl }}/build --openssldir=${{ github.workspace }}/openssl-${{ matrix.version.openssl }}/build
51+ make
52+ make install
53+
54+ - name : Setup (macos)
55+ if : matrix.os == 'macos-13'
56+ run : |
57+ echo "npm_config_openssl_dir=/usr/local/opt/[email protected] " >> "$GITHUB_ENV" 58+
59+ - name : Setup (macos arm64)
60+ if : matrix.os == 'macos-13-xlarge'
61+ run : |
62+ OPENSSL_LOCATION="npm_config_openssl_dir=$(brew --cellar [email protected] )/${{ matrix.version.openssl }}" 63+ echo $OPENSSL_LOCATION
64+ echo $OPENSSL_LOCATION >> "$GITHUB_ENV"
65+
66+ - name : Setup (windows)
67+ if : matrix.os == 'windows-2022'
2668 run : |
2769 choco install openssl --version 1.1.1.2100 --allow-downgrade -y --no-progress
2870 echo "npm_config_msvs_version=2022" >> $env:GITHUB_ENV
@@ -31,20 +73,22 @@ jobs:
3173 - name : Install
3274 env :
3375 NODEGIT_OPENSSL_STATIC_LINK : 1
34- run : npm ci --arch=x64 -- runtime=electron --target=${{ matrix.version.electron }} --target_arch=x64 --disturl=https://electronjs.org/headers --build_from_source=true
76+ run : npm ci --runtime=electron --target=${{ matrix.version.electron }} --disturl=https://electronjs.org/headers --build_from_source=true
3577
3678 - name : Deploy
3779 run : |
3880 node lifecycleScripts/clean
3981 npx node-pre-gyp package --runtime=electron --target=${{ matrix.version.electron }}
82+
4083 - name : Prepare artifact for upload
4184 run : |
4285 touch artifact.tar.gz
4386 tar -zcf artifact.tar.gz --exclude=artifact.tar.gz .
87+
4488 - name : Upload artifact
4589 uses : actions/upload-artifact@v4
4690 with :
47- name : windows -package
91+ name : ${{ matrix.os }} -package
4892 path : artifact.tar.gz
4993 if-no-files-found : error
5094 retention-days : 5
0 commit comments