Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 15 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Test
on:
push:
paths-ignore:
- ".github/workflows/prebuild.yaml"
pull_request:
paths-ignore:
- ".github/workflows/prebuild.yaml"
- push
- pull_request

jobs:
Linux:
Expand All @@ -19,12 +15,11 @@ jobs:
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev
- uses: mlugg/setup-zig@v2
- name: Install
run: npm ci --build-from-source
run: npm ci --force # https://github.com/npm/cli/issues/6138
- name: Build
run: zig build
- name: Test
run: npm test

Expand All @@ -39,15 +34,11 @@ jobs:
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
Invoke-WebRequest "https://ftp.gnome.org/pub/GNOME/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip" -OutFile "gtk.zip"
Expand-Archive gtk.zip -DestinationPath "C:\GTK"
Invoke-WebRequest "https://downloads.sourceforge.net/project/libjpeg-turbo/2.0.4/libjpeg-turbo-2.0.4-vc64.exe" -OutFile "libjpeg.exe" -UserAgent NativeHost
.\libjpeg.exe /S
choco install vcredist2010 -y
- uses: mlugg/setup-zig@v2
- name: Install
run: npm ci --build-from-source
run: npm ci --force
- name: Build
run: zig build
- name: Test
run: npm test

Expand All @@ -62,12 +53,11 @@ jobs:
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
brew update
brew install python-setuptools pkg-config cairo pango libpng jpeg giflib librsvg
- uses: mlugg/setup-zig@v2
- name: Install
run: npm ci --build-from-source
run: npm ci --force
- name: Build
run: zig build
- name: Test
run: npm test

Expand All @@ -80,7 +70,7 @@ jobs:
node-version: 20.9.0
- uses: actions/checkout@v4
- name: Install
run: npm ci --ignore-scripts
run: npm ci --force
- name: Lint
run: npm run lint
- name: Lint Types
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/prebuild.yaml

This file was deleted.

57 changes: 50 additions & 7 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,56 @@
# This is a dummy file so that this workflow shows up in the Actions tab.
# Publishing packages via CI is a 4x feature (next branch) not yet released

name: Publish
on: workflow_dispatch

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
Linux:
name: Nothing
binaries:
name: ${{ matrix.package }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { runner: macos-15, target: aarch64-macos, package: canvas-darwin-arm64 }
- { runner: macos-15, target: x86_64-macos, package: canvas-darwin-x64 }
- { runner: ubuntu-latest, target: x86-windows, package: canvas-win32-x86 }
- { runner: ubuntu-latest, target: x86_64-windows, package: canvas-win32-x64 }
- { runner: ubuntu-latest, target: aarch64-windows, package: canvas-win32-arm64 }
- { runner: ubuntu-latest, target: arm-linux-gnueabihf, package: canvas-linux-arm-gnueabihf }
- { runner: ubuntu-latest, target: x86-linux-gnu.2.28, package: canvas-linux-x86-gnu }
- { runner: ubuntu-latest, target: x86-linux-musl, package: canvas-linux-x86-musl }
- { runner: ubuntu-latest, target: x86_64-linux-gnu.2.28, package: canvas-linux-x64-gnu }
- { runner: ubuntu-latest, target: x86_64-linux-musl, package: canvas-linux-x64-musl }
- { runner: ubuntu-latest, target: aarch64-linux-gnu.2.28, package: canvas-linux-arm64-gnu }
- { runner: ubuntu-latest, target: aarch64-linux-musl, package: canvas-linux-arm64-musl }
- { runner: ubuntu-latest, target: riscv64-linux-gnu, package: canvas-linux-riscv64-gnu }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 26
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false # never use caching in release builds
- uses: mlugg/setup-zig@v2
- name: Install
run: npm ci --force # https://github.com/npm/cli/issues/6138
- name: Build
run: zig build -Dtarget=${{ matrix.target }} -Doptimize=ReleaseSafe
- name: Publish
run: npm publish --workspace ${{ matrix.package }} --tag next

root:
name: canvas
needs: binaries
runs-on: ubuntu-latest
steps:
- name: Nothing
run: echo "Nothing to do here"
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 26
- name: Install
run: npm ci --force # https://github.com/npm/cli/issues/6138
- name: Publish
run: npm publish --dry-run
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
bin
canvas.node
.DS_Store
.lock-wscript
test/images/*.png
Expand All @@ -18,3 +19,6 @@ node_modules
npm-debug.log

.idea

.zig-cache/
zig-pkg/
Loading
Loading