mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-02 02:33:55 -06:00
fix(nightly): fix CI lint/lockfile and address review comments
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -19,7 +19,6 @@ permissions: {}
|
||||
concurrency:
|
||||
group: gridcraft-nightly-release
|
||||
cancel-in-progress: false
|
||||
queue: max
|
||||
|
||||
jobs:
|
||||
release:
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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-<name>).
|
||||
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")"
|
||||
|
||||
@@ -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", ""),
|
||||
|
||||
Reference in New Issue
Block a user