Skip to content

Commit 2c481dd

Browse files
committed
fix: update mac arm64 openssl build
1 parent f2c06f9 commit 2c481dd

File tree

2 files changed

+57
-31
lines changed

2 files changed

+57
-31
lines changed

.github/workflows/package-test.yml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on: workflow_dispatch
44

55
jobs:
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
]
@@ -22,7 +23,48 @@ jobs:
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

.github/workflows/release.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
os: [ubuntu-22.04, macos-13, windows-2022]
14+
os: [ubuntu-22.04, macos-13, macos-13-xlarge, windows-2022]
1515
version: [
1616
{ node: 22.18.0, electron: 38.0.0, openssl: 1.1.1w }
1717
]
@@ -60,6 +60,13 @@ jobs:
6060
run: |
6161
echo "npm_config_openssl_dir=/usr/local/opt/[email protected]" >> "$GITHUB_ENV"
6262
63+
- name: Setup (macos arm64)
64+
if: matrix.os == 'macos-13-xlarge'
65+
run: |
66+
OPENSSL_LOCATION="npm_config_openssl_dir=$(brew --cellar [email protected])/${{ matrix.version.openssl }}"
67+
echo $OPENSSL_LOCATION
68+
echo $OPENSSL_LOCATION >> "$GITHUB_ENV"
69+
6370
- name: Setup (windows)
6471
if: matrix.os == 'windows-2022'
6572
run: |
@@ -70,7 +77,7 @@ jobs:
7077
- name: Install
7178
env:
7279
NODEGIT_OPENSSL_STATIC_LINK: 1
73-
run: npm ci --arch=x64 --runtime=electron --target=${{ matrix.version.electron }} --target_arch=x64 --disturl=https://electronjs.org/headers --build_from_source=true
80+
run: npm ci --runtime=electron --target=${{ matrix.version.electron }} --disturl=https://electronjs.org/headers --build_from_source=true
7481

7582
- name: Deploy
7683
env:
@@ -81,31 +88,6 @@ jobs:
8188
npx node-pre-gyp package --runtime=electron --target=${{ matrix.version.electron }}
8289
npx node-pre-gyp-github publish
8390
84-
- name: Setup (macos M1)
85-
if: matrix.os == 'macos-13'
86-
run: |
87-
brew install grep
88-
brew uninstall --ignore-dependencies [email protected]
89-
FILE=$(brew fetch --force --bottle-tag=arm64_big_sur [email protected] | ggrep -oP '(?<=Downloaded to\: ).*')
90-
echo "$FILE"
91-
brew install "$FILE"
92-
93-
- name: Install (macos M1)
94-
if: matrix.os == 'macos-13'
95-
env:
96-
NODEGIT_OPENSSL_STATIC_LINK: 1
97-
run: npm ci --arch=arm64 --runtime=electron --target=${{ matrix.version.electron }} --target_arch=arm64 --disturl=https://electronjs.org/headers --build_from_source=true
98-
99-
- name: Deploy (macos M1)
100-
if: matrix.os == 'macos-13'
101-
env:
102-
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103-
run: |
104-
npm install -g @mapbox/node-pre-gyp
105-
node lifecycleScripts/clean
106-
npx node-pre-gyp package --runtime=electron --target=${{ matrix.version.electron }} --arch=arm64 --target_arch=arm64
107-
npx node-pre-gyp-github publish
108-
10991
- name: Prepare artifact for upload
11092
if: matrix.os == 'ubuntu-22.04'
11193
run: |

0 commit comments

Comments
 (0)