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
37 changes: 37 additions & 0 deletions .github/workflows/flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: flake

# Builds the Nix flake so a stale vendorHash (or a flake that no longer
# evaluates/builds) fails CI instead of silently shipping a broken
# `nix run github:civitai/cli`. vendorHash drifts whenever go.mod/go.sum change,
# so this runs on those + the flake files. To fix a failure: set vendorHash to
# lib.fakeHash in flake.nix, run `nix build`, and copy the `got:` value.
on:
pull_request:
paths:
- go.mod
- go.sum
- flake.nix
- flake.lock
- .github/workflows/flake.yml
push:
branches: [main]
paths:
- go.mod
- go.sum
- flake.nix
- flake.lock
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: nix build .#default (validates vendorHash + build)
run: nix build .#default
- name: run the built binary
run: ./result/bin/civitai version
Comment on lines +27 to +37
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Computed from go.sum (this module is not vendored). To recompute
# after a go.mod/go.sum change: set this to `lib.fakeHash`, run
# `nix build`, and copy the `got: sha256-…` value from the error.
vendorHash = "sha256-tOrwJxtpwKWfY4ACZYFilGWulS9UdHP58M2O5NgS09E=";
vendorHash = "sha256-prgKRC+357KX7vJ9jcIq2+1FUD91a2Gg5Q89R+FTZ+g=";

# The module root is `package cli` (a library that embeds the schema);
# the executable lives in ./cmd/civitai (package main). Build only it.
Expand Down
Loading