Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ jobs:
# Its wheel carries the library's built script and stylesheet.
- run: bin/assets && python3.14 -m pip install --quiet build && python3.14 -m build --wheel && unzip -l dist/*.whl | grep -q visualci_gallery/static/visualci_gallery/visualci_gallery.js
working-directory: clients/gallery/python
# The gallery's Rust renderer (its own workspace): the contract's golden fixtures, Askama included, and clippy.
- run: cargo test --locked --all-features && cargo clippy --locked --all-features --all-targets -- -D warnings
working-directory: clients/gallery/rust
# The Compare two PDFs page runs crates/visualci-wasm in the browser (scripts/wasm.mjs builds it).
- run: rustup target add wasm32-unknown-unknown
# Compile cache (kache, as Cargo's rustc wrapper): the R2 bucket every machine shares (KACHE_BUCKET), else the
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release-gallery-crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Publish the visualci-gallery crate (clients/gallery/rust) to crates.io. Runs for a gallery-rust-v* tag (matching the
# version in its Cargo.toml) or by hand. crates.io's trusted publishing (OIDC from this workflow) works only for a crate
# that already exists, so the first publish uses a temporary token in the CRATES_IO_TOKEN secret (kept in 1Password as
# visualci-crates-io-publish-token, Nathan's Tasks sc-9327). After that, trusted publishing is set up for this workflow,
# the secret is deleted and the token revoked; without the secret, the workflow publishes through OIDC.
name: Release gallery crate

on:
push:
tags: ["gallery-rust-v*"]
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
defaults:
run:
working-directory: clients/gallery/rust
steps:
- uses: actions/checkout@v4
- name: The tag matches the crate's version
if: startsWith(github.ref, 'refs/tags/gallery-rust-v')
run: |
version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
test "gallery-rust-v$version" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME, crate $version"; exit 1; }
- run: cargo test --locked --all-features
- id: oidc
if: env.CRATES_IO_TOKEN == ''
uses: rust-lang/crates-io-auth-action@v1
- run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ env.CRATES_IO_TOKEN || steps.oidc.outputs.token }}
4 changes: 2 additions & 2 deletions clients/gallery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ variables.
pipeline.
- [`python/`](python/README.md): the `visualci-gallery` package, standard library only, with the library's files for
Django's static files.
- [`rust/`](rust/README.md): the `visualci-gallery` crate, from plain Rust or an Askama template.

A pnpm workspace: `pnpm install && pnpm build && pnpm test` here. Coming: the Rust crate, emitting the contract's
markup for the JS library to hydrate.
The JS packages are a pnpm workspace: `pnpm install && pnpm build && pnpm test` here.
1 change: 1 addition & 0 deletions clients/gallery/rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
Loading
Loading