Task 25: Packaging and release workflow (#25) #95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/25-packaging-release"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: task/14-app-runtime, task/24-screenshot-tests
What this builds
cargo xtask package --target <linux|windows> [--version <v>] [--out-dir <dir>](xtask/src/package.rs): release build offluxer(--no-default-features, so no devserver), thendist/Fluxer-Native-<version>-linux-x86_64.AppImage. AppDir staged frompackaging/linux(AppRun,fluxer-native.desktop,fluxer-native.svg) plus the binary; squashed byappimagetool1.9.1 with the type-2 runtime 20251108. Both are downloaded withcurlon first use into the target dir and used only if they match the SHA-256 pinned in the source. No FUSE needed (APPIMAGE_EXTRACT_AND_RUN=1).dist/Fluxer-Native-<version>-win-x64.exe, static CRT, icon (packaging/windows/fluxer-native.ico) and version resource embedded byapps/fluxer/build.rs.dist/SHA256SUMS(sha256sum --checkformat).--version, else thenative-*tag onHEADwithout its prefix, else0.0.0-dev+<sha>. Packaging for the other OS is refused (no cross-compiling)..forgejo/workflows/release.yaml(workflow_dispatch, inputversion):preparevalidates the version and creates a draft release;linuxandwindowsruncargo xtask package, smoke-test the package (--debug-info) and upload it to the draft;publishwritesSHA256SUMSfrom the checksums each build machine computed, checks both assets are attached, uploads it and publishes the draft (which creates the tagnative-<version>). A failed run leaves at most a draft; an existing release or tag is never replaced.fluxer_desktop/build_resources/icons-stablein the fork): the.icois copied, the SVG is the logo mark on the brand disc, matching the fork's512x512.png.How it was tested
xtask/tests/package.rs::package_produces_appimage_on_linux(written first, seen failing on the unimplemented subcommand): AppImage exists, is executable,--appimage-extractworks,squashfs-root/usr/bin/fluxer --debug-infoandsquashfs-root/AppRun --debug-infoexit 0,SHA256SUMSverifies. Alsopackaging_for_another_os_is_refused, and unit tests for version parsing, package names andSHA256SUMSmerging.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally on Linux (base and this branch).ubuntu:22.04container (what the runner uses): it works without FUSE oncefileis installed, which is whyfileis added to the apt lists.cargo clippy -p xtask --all-targets --target x86_64-pc-windows-msvc -- -D warningsis clean; the Windows-only part ofbuild.rswas type-checked in a scratch crate. The shell steps ofrelease.yamlpassbash -nand the publish job's checksum validation was run against sample data.Not verified here (please look)
release.yamlwas not dispatched. The plan asks for one dispatch with2026.1111.0. That publishes a real release and tag from an unmerged task branch, and I cannot watch the run. Left for Charles after merge:tools/fj.sh POST /repos/charles/fluxer-native/actions/workflows/release.yaml/dispatches '{"ref":"<branch>","inputs":{"version":"2026.1111.0"}}'. Until the first run, the workflow (job outputs between jobs, draft → publish through the API) is untested on the runners.package_produces_portable_exe_on_windows(new, runs on the Windows runner as part ofcargo xtask ci), thewinresourcestep inbuild.rs(needs the SDK'src.exe; a normal build only warns without it, the packaging build fails), and the+crt-staticrelease build.Deviations from the plan
winresource0.1 instead ofwinres:winres(last release 2021) links the resource into every target of the package, which breaks a package that has a library and a binary, asapps/fluxerdoes;winresourceis its maintained fork and links it into thefluxerbinary only. The metadata table is therefore[package.metadata.winresource], and the icon path is set inbuild.rs(every key of that table becomes a version-info string, so it cannot hold a path).Cargo.toml/Cargo.lock(winresource),xtask/Cargo.toml(sha2, already a workspace dependency;tempfilefor the test),xtask/src/main.rs(dispatch),xtask/tests/ci_smoke.rs(its "package is unimplemented" test became "package needs a target"),.forgejo/workflows/ci.yaml(filein the Linux apt list),xtask/README.mdandapps/fluxer/README.md.--versionand--out-dirflags added: the release workflow builds before the tag exists, and the test must not write intodist/.GITHUB_TOKENsecret (as inci.yamland the fork's release job), not a separately created secret.cargo xtask cinow does a release build on Linux and Windows and, on Linux, needs network once to fetch the two pinned tools.fluxer --debug-infostill prints the crate version (0.1.0) and the commit. Changing that touchesdebug_info.rs(Task 14) and the version sent to the gateway, so it is left for a decision.Closes #25
🤖 Generated with Claude Code
Independent review: Task 25 (packaging-release), commit
1f68186Reviewed
480fde6..1f68186only, read cold.Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh worktree and target dir on Linux: green ("all steps passed"), includingpackage_produces_appimage_on_linux,packaging_for_another_os_is_refusedandpackage_needs_a_target. Nothing Windows-specific was run by me either.Checks
xtask/tests/package.rs::package_produces_appimage_on_linuxexists and asserts what the plan says: file exists, is executable,--appimage-extractsucceeds,squashfs-root/usr/bin/fluxer --debug-infoexits 0 (plusAppRun --debug-infoandSHA256SUMS). Linux-only viacfg.cargo xtask package --target linux->dist/Fluxer-Native-<version>-linux-x86_64.AppImage,--target windows->dist/Fluxer-Native-<version>-win-x64.exe+SHA256SUMS; version from thenative-*tag or0.0.0-dev+<sha>; appimagetool and runtime downloaded and SHA-256 verified before use.release.yamlisworkflow_dispatchwith inputversion, a Linux job, a Windows job and a final publish job creatingnative-<version>with both assets andSHA256SUMS. Names match the plan.fluxer-coreorfluxer-ui; no secrets or tokens in code or assets; the workflow passes the token through the environment and masks it in the checkout log;cargo denygreen withwinresource.Findings
.forgejo/workflows/release.yaml(prepare): the "already exists" check runsGET releases/tags/native-<version>before the stale drafts are deleted. As far as I know Forgejo returns a draft release from that endpoint to a token with write access, so a draft left by a failed run would make the rerun stop with "already exists, bump N" instead of the documented "the next run removes it and starts over". Not verified here (it needs a draft on the real repo). Fix: delete stale drafts first, or let the check ignore.draft == true..forgejo/workflows/release.yaml: the workflow has never run (plan step "dispatch once with 2026.1111.0 and verify assets" is not done). Only reading-level review was possible: draft creation without a tag, cross-jobsumsoutputs, and tag creation onPATCH {"draft": false}are untested on this Forgejo. Needs one dispatch after merge; until then spec §9 item 10 is open. Should be afollow-upissue linked from this PR.apps/fluxer/build.rs,xtask/src/package.rs(Windows path): unverified on Windows by implementer and by me.package_produces_portable_exe_on_windowsis not ignored and builds withFLUXER_REQUIRE_ICON=1, so the Windows CI job goes red if the runner has norc.exe, or if thecfg(windows)build-script code trips clippy-D warnings. I checked thewinresource0.1.34 API against the source (set_icon(&str),compile_for(&str),[package.metadata.winresource]is the table it reads): it matches. The Windows runner result on this commit is the only real evidence; the integrator must see it green before merging.xtask/tests/package.rs:cargo xtask cinow does a release build and, on Linux, downloads two files from github.com when<target>/package/toolsis empty (every run in a fresh CI container unless the target dir is cached). The hashes are pinned, so this is an availability dependency, not an integrity one.apps/fluxer/Cargo.toml:winresourceinstead of the plan'swinres, and[package.metadata.winresource]instead of[package.metadata.winres]. No other task consumes the name; acceptable, but the plan text should be updated.xtask/src/package.rs: the release version only names the file; the binary reports crate version 0.1.0 and packages have nodevserverfeature, which Task 26 step 2 ("run the AppImage against the devserver") has to account for.Verdict: APPROVE (0 blocking, 6 minor; local ci green on Linux). Conditions for the integrator: Windows runner green on this commit, and a follow-up issue for the first
release.yamldispatch.