Support rebuild #259
This file contains 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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build, test, and upload prebuilds | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-x64: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache vcpkg | |
uses: actions/cache@v3 | |
env: | |
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#environment-variables | |
VCPKG_INSTALLATION_ROOT: C:\vcpkg | |
cache-name: cache-vcpkg | |
with: | |
path: ${{ env.VCPKG_INSTALLATION_ROOT }} | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Install linux deps | |
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- name: Install windows deps | |
run: vcpkg install curl openssl --triplet=x64-windows-static | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- run: npm i | |
- run: npm test | |
- run: npm run prebuild | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }} | |
path: ./prebuilds | |
build-aarch64: | |
# The host should always be Linux | |
runs-on: ubuntu-latest | |
name: Build on aarch64 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Run commands | |
with: | |
arch: aarch64 | |
distro: ubuntu_latest | |
run: | | |
# install deps | |
apt update | |
apt install -y libcurl4-openssl-dev git cmake build-essential libssl-dev | |
# Install nodejs | |
apt install -y ca-certificates curl gnupg | |
mkdir -p /etc/apt/keyrings | |
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | |
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | |
apt update | |
apt install -y nodejs | |
# Build | |
git config --global --add safe.directory '*' | |
npm run fetch-deps | |
npm run build-transmission | |
npm i | |
npm test | |
npm run prebuild-arm64 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ubuntu-latest | |
path: ./prebuilds |