version 1.0.2 #30
Workflow file for this run
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
name: Compile binaries | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
linux-x86: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
libc: [glibc, musl] | |
container: | |
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }} | |
steps: | |
- name: Install rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Checkout skia-canvas | |
uses: actions/checkout@v4 | |
with: | |
path: skia-canvas | |
- name: Build module | |
run: | | |
cd skia-canvas | |
npm ci --ignore-scripts | |
npm run build -- --release --features vulkan,window,skia-safe/embed-freetype | |
- name: Package module | |
run: | | |
cd skia-canvas | |
npm test && npm run package | |
- name: Add to release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -sL https://github.com/cli/cli/releases/download/v2.55.0/gh_2.55.0_linux_amd64.tar.gz | tar xz --strip-components=2 | |
mv gh skia-canvas/node_modules/.bin | |
cd skia-canvas | |
npm run upload | |
linux-arm64: | |
runs-on: | |
- self-hosted | |
- linux | |
- ARM64 | |
strategy: | |
fail-fast: false | |
matrix: | |
libc: [glibc, musl] | |
container: | |
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }} | |
options: --user 1000:1000 | |
steps: | |
- name: Prepare workspace | |
run: | | |
rm -rf "$GITHUB_WORKSPACE" | |
mkdir -p "$GITHUB_WORKSPACE" | |
- name: Install rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Checkout skia-canvas | |
id: rust-skia | |
env: | |
SERVER: ${{ github.server_url }} | |
REPO: ${{ github.repository }} | |
run: | | |
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${SERVER}/${REPO} skia-canvas | |
export TAG=$(make -sC skia-canvas skia-version) | |
make -sC skia-canvas with-local-skia | |
echo "VERSION=$TAG" >> $GITHUB_OUTPUT | |
echo REF ${GITHUB_REF_NAME} | |
- name: Checkout rust-skia | |
run: | | |
git clone --depth 1 --branch ${{ steps.rust-skia.outputs.VERSION }} https://github.com/rust-skia/rust-skia.git | |
cd rust-skia | |
git submodule update --init --depth 1 skia-bindings/skia | |
git submodule update --init --depth 1 skia-bindings/depot_tools | |
- name: Use system GN | |
if: ${{ matrix.libc == 'musl' }} | |
run: | | |
echo "#!/bin/true" > rust-skia/skia-bindings/skia/bin/fetch-gn | |
- name: Build module | |
run: | | |
cd skia-canvas | |
npm ci --ignore-scripts | |
npm run build -- --release --features vulkan,window,skia-safe/embed-freetype | |
- name: Package module | |
run: | | |
cd skia-canvas | |
npm test && npm run package | |
- name: Add to release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -sL https://github.com/cli/cli/releases/download/v2.55.0/gh_2.55.0_linux_arm64.tar.gz | tar xz --strip-components=2 | |
mv gh skia-canvas/node_modules/.bin | |
cd skia-canvas | |
npm run upload | |
mac: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86, arm64] | |
runs-on: ${{ matrix.arch == 'x86' && 'macos-13' || 'macos-latest' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Use Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Build module | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
run: | | |
npm ci --ignore-scripts | |
npm run build -- --release --features metal,window | |
- name: Package module | |
run: | | |
npm test && npm run package | |
- name: Add to release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm run upload | |
windows-x86: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Use Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Build module | |
run: | | |
npm ci --ignore-scripts | |
npm run build -- --release --features vulkan,window | |
- name: Package module | |
run: | | |
npm test && npm run package | |
- name: Add to release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm config set script-shell bash | |
npm run upload | |