fix(ci): defer full Nix build until release

This commit is contained in:
t8y2 committed 2026-07-22 17:20:16 +08:00
1 parent c180c40b36
commit 697b7a4b80
4 files changed
+24 -12

No files matched your search

+3 -7
View File
@@ -286,8 +286,8 @@ jobs:
- name: Install Nix - name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22 uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
- name: Build Nix package - name: Validate pnpm dependency hash
run: nix build .#dbx-desktop --no-link --print-build-logs run: nix build .#dbx-pnpm-deps --no-link --print-build-logs
changes: changes:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@@ -340,17 +340,13 @@ jobs:
agents: agents:
- 'agents/**' - 'agents/**'
nix: nix:
# The fixed-output pnpm hash must change whenever the workspace dependency graph changes. # This fast check validates only the fixed-output pnpm dependency closure.
- 'package.json' - 'package.json'
- 'packages/**/package.json' - 'packages/**/package.json'
- 'pnpm-lock.yaml' - 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml' - 'pnpm-workspace.yaml'
- 'flake.nix' - 'flake.nix'
- 'flake.lock' - 'flake.lock'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/**/Cargo.toml'
- 'src-tauri/Cargo.toml'
- '.github/workflows/ci.yml' - '.github/workflows/ci.yml'
- '.github/workflows/update-nix-pnpm-hash.yml' - '.github/workflows/update-nix-pnpm-hash.yml'
+13 -1
View File
@@ -14,6 +14,17 @@ env:
CNB_REGISTRY: "docker.cnb.cool" CNB_REGISTRY: "docker.cnb.cool"
jobs: jobs:
nix-packaging:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
- name: Build Nix desktop package
run: nix build .#dbx-desktop --no-link --print-build-logs
bump-jdbc-plugin-version: bump-jdbc-plugin-version:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
@@ -381,7 +392,8 @@ jobs:
--clobber --clobber
publish: publish:
needs: [cleanup-release-signatures, docker-manifest, jdbc-plugin] # Keep the release as a draft until every platform and the Nix package pass.
needs: [cleanup-release-signatures, docker-manifest, jdbc-plugin, nix-packaging]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Publish draft release - name: Publish draft release
+3 -3
View File
@@ -35,8 +35,8 @@ jobs:
set -euo pipefail set -euo pipefail
build_log=$(mktemp) build_log=$(mktemp)
if nix build .#dbx-desktop --no-link --print-build-logs >"$build_log" 2>&1; then if nix build .#dbx-pnpm-deps --no-link --print-build-logs >"$build_log" 2>&1; then
echo "Nix package already has the correct pnpm hash." echo "Nix pnpm dependencies already have the correct hash."
exit 0 exit 0
fi fi
@@ -50,7 +50,7 @@ jobs:
EXPECTED_HASH="$expected_hash" perl -0pi -e \ EXPECTED_HASH="$expected_hash" perl -0pi -e \
's/(hash = ")sha256-[^"]+(")/$1 . $ENV{EXPECTED_HASH} . $2/e' flake.nix 's/(hash = ")sha256-[^"]+(")/$1 . $ENV{EXPECTED_HASH} . $2/e' flake.nix
nix build .#dbx-desktop --no-link --print-build-logs nix build .#dbx-pnpm-deps --no-link --print-build-logs
if git diff --quiet -- flake.nix; then if git diff --quiet -- flake.nix; then
echo "The Nix build passed without changing flake.nix." echo "The Nix build passed without changing flake.nix."
+5 -1
View File
@@ -150,6 +150,10 @@
# Convenience alias # Convenience alias
packages.default = self.packages.${system}.dbx-desktop; packages.default = self.packages.${system}.dbx-desktop;
# Fast fixed-output target used by CI to validate pnpm dependency hashes
# without compiling the frontend and Rust desktop application.
packages.dbx-pnpm-deps = self.packages.${system}.dbx-desktop.pnpmDeps;
# ------------------------------------------------------------------ # # ------------------------------------------------------------------ #
# packages.dbx-desktop — Tauri desktop application # # packages.dbx-desktop — Tauri desktop application #
# Build with: nix build .#dbx-desktop # # Build with: nix build .#dbx-desktop #
@@ -178,7 +182,7 @@
# `fetcherVersion = 4` is supported for `pnpm_11` # `fetcherVersion = 4` is supported for `pnpm_11`
fetcherVersion = 4; fetcherVersion = 4;
# Update with the hash reported by a failed fixed-output build: # Update with the hash reported by a failed fixed-output build:
# nix build .#dbx-desktop 2>&1 | grep 'got:' # nix build .#dbx-pnpm-deps 2>&1 | grep 'got:'
hash = "sha256-Bt3AwBVAdA96B4UWBVDvwNBy/JX2eNn8adPpWueAjcs="; hash = "sha256-Bt3AwBVAdA96B4UWBVDvwNBy/JX2eNn8adPpWueAjcs=";
}; };