jxl-oxide v0.11.0 (#407) #465
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
on: | |
push: | |
branches: | |
- main | |
- v*.x | |
workflow_dispatch: {} | |
name: Build | |
jobs: | |
build: | |
name: Compile | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}- | |
${{ runner.os }}-dot-cargo- | |
- name: Detect host triple | |
id: detect-host | |
shell: bash | |
run: | | |
rustc -vV | sed -ne 's/^host: /host=/p' >> "$GITHUB_OUTPUT" | |
- run: cargo build --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: jxl-oxide-cli-${{ steps.detect-host.outputs.host }} | |
path: | | |
target/release/jxl-oxide | |
target/release/jxl-oxide.exe | |
cross: | |
name: Cross-compile | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- armv7-unknown-linux-gnueabihf | |
- aarch64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
with: | |
targets: ${{ matrix.target }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}- | |
${{ runner.os }}-dot-cargo- | |
- name: Install cross | |
uses: taiki-e/cache-cargo-install-action@v2 | |
with: | |
tool: cross | |
git: https://github.com/cross-rs/cross | |
rev: 7b79041c9278769eca57fae10c74741f5aa5c14b | |
- run: cross build --release --target ${{ matrix.target }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: jxl-oxide-cli-${{ matrix.target }} | |
path: | | |
target/${{ matrix.target }}/release/jxl-oxide | |
wasm: | |
name: WebAssembly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}- | |
${{ runner.os }}-dot-cargo- | |
- name: Install wasm-pack | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: wasm-pack@0.13.0 | |
- name: Install wasm-bindgen | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: wasm-bindgen@0.2.93 | |
- name: Build WebAssembly module | |
working-directory: crates/jxl-oxide-wasm | |
run: | | |
RUSTFLAGS='-C target-feature=+simd128' wasm-pack build --release --target web --reference-types | |
node ./update-package-json.mjs | |
wasm-pack pack | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: jxl-oxide-wasm | |
path: crates/jxl-oxide-wasm/pkg/jxl-oxide-wasm-*.tgz | |
compression-level: 0 |