From b665e351c1ca81077e808fff11db0c6a53610f0f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 24 Nov 2026 14:21:57 -0500 Subject: [PATCH] fix(nightly): fix CI lint/lockfile and address review comments --- .github/workflows/actions.lock | 2 ++ .github/workflows/nightly-sign.yml | 1 - apps/gridcraft/src/main.rs | 14 +++++++++++++- packaging/linux/flatpak-bundle.sh | 2 +- packaging/linux/package.sh | 6 +++++- packaging/nightly-release-tests.py | 12 ++++-------- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 6917bde73..b463b78c5 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -9,6 +9,8 @@ workflows: '.github/workflows/lockfile.yml': - 'actions/checkout@v7.0.1' - 'step-security/harden-runner@v2.22.4' + '.github/workflows/nightly-sign.yml': [] + '.github/workflows/nightly.yml': [] '.github/workflows/nix.yml': [] '.github/workflows/packaging-lint.yml': - 'actions/checkout@v7.0.1' diff --git a/.github/workflows/nightly-sign.yml b/.github/workflows/nightly-sign.yml index 14e5a0c00..4430db094 100644 --- a/.github/workflows/nightly-sign.yml +++ b/.github/workflows/nightly-sign.yml @@ -19,7 +19,6 @@ permissions: {} concurrency: group: gridcraft-nightly-release cancel-in-progress: false - queue: max jobs: release: diff --git a/apps/gridcraft/src/main.rs b/apps/gridcraft/src/main.rs index 858c7f9d1..792cb2d78 100644 --- a/apps/gridcraft/src/main.rs +++ b/apps/gridcraft/src/main.rs @@ -344,11 +344,23 @@ fn main() -> eframe::Result<()> { // Linux/BSD: Excel's layout — no window-manager title bar above ours; our title bar carries the // window controls. `GRIDCRAFT_SYSTEM_TITLEBAR=1` keeps the system frame. app.window_controls = cfg!(not(any(target_os = "macos", target_os = "windows"))) && std::env::var_os("GRIDCRAFT_SYSTEM_TITLEBAR").is_none(); + let app_id = std::env::var("FLATPAK_ID") + .ok() + .filter(|id| !id.is_empty()) + .unwrap_or_else(|| { + if option_env!("GRIDCRAFT_BUILD_CHANNEL") == Some("nightly-v1") + || env!("CARGO_PKG_VERSION").contains("-nightly") + { + "ai.storyteller.gridcraft.nightly-v1".to_string() + } else { + "ai.storyteller.gridcraft".to_string() + } + }); let mut viewport = egui::ViewportBuilder::default() .with_title("GridCraft") .with_inner_size([1440.0, 900.0]) .with_min_inner_size([640.0, 420.0]) - .with_app_id("ai.storyteller.gridcraft") + .with_app_id(app_id) .with_drag_and_drop(true) .with_decorations(!app.window_controls); if cfg!(target_os = "macos") { diff --git a/packaging/linux/flatpak-bundle.sh b/packaging/linux/flatpak-bundle.sh index 56350a0f6..0ce682293 100755 --- a/packaging/linux/flatpak-bundle.sh +++ b/packaging/linux/flatpak-bundle.sh @@ -61,7 +61,7 @@ tar -xzf "$TARBALL" -C "$WORK/stage" --strip-components=1 if [[ "$FLATPAK_ID" != "$APP_ID" ]]; then sed -e "s|^Icon=$APP_ID$|Icon=$FLATPAK_ID|" \ -e "s|^Name=GridCraft$|Name=GridCraft Nightly|" \ - -e 's|^StartupWMClass=.*|StartupWMClass=ai.storyteller.gridcraft.nightly-v1|' \ + -e "s|^StartupWMClass=.*|StartupWMClass=$FLATPAK_ID|" \ -e '/^MimeType=/d' \ "$WORK/stage/share/applications/$APP_ID.desktop" >"$WORK/stage/share/applications/$FLATPAK_ID.desktop" rm -f "$WORK/stage/share/applications/$APP_ID.desktop" diff --git a/packaging/linux/package.sh b/packaging/linux/package.sh index 17359b4f2..2ccc1a2c8 100755 --- a/packaging/linux/package.sh +++ b/packaging/linux/package.sh @@ -248,7 +248,11 @@ if has appimage; then fi # Absolute, because appimagetool runs in $DIST below (CARGO_TARGET_DIR, APPIMAGETOOL or # APPIMAGE_RUNTIME may be relative, e.g. target/agent-). - OUT="$(cd "$DIST" && pwd)/$BASENAME.AppImage" + APPIMAGE_BASENAME="$BASENAME" + if [[ "$IS_NIGHTLY" = 1 && "$VERSION" != *-nightly* ]]; then + APPIMAGE_BASENAME="gridcraft-$VERSION-nightly-linux-$ARCH" + fi + OUT="$(cd "$DIST" && pwd)/$APPIMAGE_BASENAME.AppImage" APPDIR="$(cd "$APPDIR" && pwd)" TOOL="$(cd "$(dirname "$TOOL")" && pwd)/$(basename "$TOOL")" RUNTIME="$(cd "$(dirname "$RUNTIME")" && pwd)/$(basename "$RUNTIME")" diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py index 55eb4c038..ef1d1e966 100755 --- a/packaging/nightly-release-tests.py +++ b/packaging/nightly-release-tests.py @@ -35,12 +35,12 @@ def assert_nightly_serialization(source): continue if not line[0].isspace(): break - row = re.fullmatch(r" (group|cancel-in-progress|queue): ([^#]+?)(?: +#.*)?", line) + row = re.fullmatch(r" (group|cancel-in-progress): ([^#]+?)(?: +#.*)?", line) if row is None or row[1] in values: raise ValueError("malformed or duplicate nightly concurrency entry") values[row[1]] = row[2].rstrip() - if values != {"group": "gridcraft-nightly-release", "cancel-in-progress": "false", "queue": "max"}: - raise ValueError("nightly serialization must use its stable group, max queue and no cancellation") + if values != {"group": "gridcraft-nightly-release", "cancel-in-progress": "false"}: + raise ValueError("nightly serialization must use its stable group and no cancellation") def job_conditions(jobs): @@ -158,11 +158,7 @@ class TrustedSourcePreparation(unittest.TestCase): def test_weakened_or_malformed_serialization_is_rejected(self): source = (ROOT / ".github/workflows/nightly-sign.yml").read_text() for old, new in ( - ("queue: max", "queue: single"), - ("queue: max", "queue: invalid"), - ("queue: max", "queue: ${{ github.run_id }}"), - ("queue: max", "queue:"), - ("queue: max", "queue: max\n queue: single"), + ("cancel-in-progress: false", "cancel-in-progress: false\n queue: max"), ("cancel-in-progress: false", "cancel-in-progress: true"), ("cancel-in-progress: false", "cancel-in-progress: ${{ github.event_name == 'push' }}"), ("cancel-in-progress: false\n", ""),