Generate stagings and packages#5
Open
alexadereyko wants to merge 9 commits into
Open
Conversation
b2e41d2 to
ead42e6
Compare
After Build, run cpack -G TGZ and upload the tarball together with staging-meta.json as the staging-<job> artifact.
Staging is a tarball of the build binaries meant for dependent projects: they consume the prebuilt output (via find_package) instead of rebuilding it every time. Packaging is for the cases that need a native package -- DEB, NSIS, PKG. Both are driven by the `packaging` input -- a JSON array of objects, resolved per job (last-match-wins), each with: - match-jobs: job-name patterns the object applies to; - enable-staging: enables generation of the staging tarball (default false when omitted); - package: the cpack generator name used to build the package (when omitted, no package is generated). Staging and packaging are uploaded as the staging-<job> and package-<job> artifacts of the workflow.
Pull dependency staging artifacts named in packages.artifacts (* -> job name) and extract each into its dir before configure, so a build resolves them via find_package / CMAKE_PREFIX_PATH. Pass cmake-presets.build-targets into buildPresets.targets and packaging.variables into the staging packagePreset, so a caller can scope the build to a target and the staging to a CPack component.
stage-core builds only the hello-core target and stages the core component; stage-module pulls that staging from the same run, resolves hello-core via find_package, and stages the module component. Drop the now-redundant staging packaging from test-reusable -- the new workflow covers the staging scenario.
When a job produces a staging, render its staging-meta.json into the GitHub job summary so the package metadata is visible in the UI. The summary step now always runs: metadata on staging builds, the existing reproduction block on failure.
Rename the packaging input to cpack-presets, mirroring the cmake-presets input. Per job, generate a hidden packagePreset named after the job; depending on the entry fields it gains up to two inheritors, <job>-staging (TGZ) and <job>-package (native installer). An optional package-preset field names a project packagePreset for the hidden base to inherit.
stage-core and stage-module also request a native installer per OS (DEB, NSIS, productbuild), scoped to the built component; NSIS is installed via choco on Windows.
ead42e6 to
02f9cd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add staging and packaging to the
reusableworkflow: generate component stagings and native installers via CPack presets, consume dependency stagings, and build specific targets. Builds on #4 (thehellovehicle), which drives the newtest-stagingworkflow end to end.Changes
cpack-presetsinput. Per job, generates CPackpackagePresets— a hidden base inherited by<job>-staging(TGZ) and/or<job>-package(native installer:DEB/NSIS/productbuild).variablescarry CPack settings (e.g. component scoping);package-presetlets the base inherit a project preset. Uploaded asstaging-<job>/package-<job>, excluding the cpack temp dir.packagesartifactsfield. Downloads and extracts dependency stagings before configure, so a build resolves them viafind_package/CMAKE_PREFIX_PATHinstead of rebuilding.cmake-presetsbuild-targets. Builds only the listed targets (e.g. a single wrapper) by setting the build preset'stargets.staging-meta.jsoninto the GitHub job summary; the failure summary lists the stage/package reproduction commands.test-stagingworkflow. Drives the full scenario on Linux/Windows/macOS:stage-coreproduces the core staging + installer,stage-moduleconsumes it and produces the module staging + installer (component-scoped).