fix: update mac arm64 openssl build #78
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - v*.*.* | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-13, macos-13-xlarge, windows-2022] | |
| version: [ | |
| { node: 22.18.0, electron: 38.0.0, openssl: 1.1.1w } | |
| ] | |
| steps: | |
| - name: Checkout git repository | |
| uses: actions/checkout@v4 | |
| - name: Install node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.version.node }} | |
| check-latest: true | |
| cache: 'npm' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup (linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y software-properties-common git build-essential clang libssl-dev libkrb5-dev libc++-dev wget zlib1g-dev | |
| echo "npm_config_openssl_dir=${{ github.workspace }}/openssl-${{ matrix.version.openssl }}/build" >> "$GITHUB_ENV" | |
| - name: Cache Openssl (linux) | |
| if: matrix.os == 'ubuntu-22.04' | |
| id: cache-openssl | |
| uses: actions/cache@v4 | |
| with: | |
| path: openssl-${{ matrix.version.openssl }} | |
| key: ${{ runner.os }}-openssl-${{ matrix.version.openssl }} | |
| - name: Build Openssl (linux) | |
| if: matrix.os == 'ubuntu-22.04' && steps.cache-openssl.outputs.cache-hit != 'true' | |
| run: | | |
| wget -qO- https://www.openssl.org/source/openssl-${{ matrix.version.openssl }}.tar.gz | tar -xz | |
| cd openssl-${{ matrix.version.openssl }} | |
| ./config --prefix=${{ github.workspace }}/openssl-${{ matrix.version.openssl }}/build --openssldir=${{ github.workspace }}/openssl-${{ matrix.version.openssl }}/build | |
| make | |
| make install | |
| - name: Setup (macos) | |
| if: matrix.os == 'macos-13' | |
| run: | | |
| echo "npm_config_openssl_dir=/usr/local/opt/openssl@1.1" >> "$GITHUB_ENV" | |
| - name: Setup (macos arm64) | |
| if: matrix.os == 'macos-13-xlarge' | |
| run: | | |
| OPENSSL_LOCATION="npm_config_openssl_dir=$(brew --cellar openssl@1.1)/${{ matrix.version.openssl }}" | |
| echo $OPENSSL_LOCATION | |
| echo $OPENSSL_LOCATION >> "$GITHUB_ENV" | |
| - name: Setup (windows) | |
| if: matrix.os == 'windows-2022' | |
| run: | | |
| choco install openssl --version 1.1.1.2100 --allow-downgrade -y --no-progress | |
| echo "npm_config_msvs_version=2022" >> $env:GITHUB_ENV | |
| echo "npm_config_openssl_dir=C:\Program Files\OpenSSL" >> $env:GITHUB_ENV | |
| - name: Install | |
| env: | |
| NODEGIT_OPENSSL_STATIC_LINK: 1 | |
| run: npm ci --runtime=electron --target=${{ matrix.version.electron }} --disturl=https://electronjs.org/headers --build_from_source=true | |
| - name: Deploy | |
| env: | |
| NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| npm install -g @mapbox/node-pre-gyp | |
| node lifecycleScripts/clean | |
| npx node-pre-gyp package --runtime=electron --target=${{ matrix.version.electron }} | |
| npx node-pre-gyp-github publish | |
| - name: Prepare artifact for upload | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| touch artifact.tar.gz | |
| tar -zcf artifact.tar.gz --exclude=artifact.tar.gz . | |
| - name: Upload artifact | |
| if: matrix.os == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-ubuntu | |
| path: artifact.tar.gz | |
| if-no-files-found: error | |
| retention-days: 5 | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-ubuntu | |
| - name: Extract artifact | |
| run: tar -xzf artifact.tar.gz | |
| - name: Publish | |
| env: | |
| NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
| run: | | |
| npm config set //registry.npmjs.org/:_authToken ${NPM_PUBLISH_TOKEN} | |
| npm publish --access public |