Skip to content

Add tag-triggered release workflow with portable binary packaging#77

Merged
particlesector merged 1 commit into
mainfrom
claude/ci-release-build-workflow-zahlnf
Jul 17, 2026
Merged

Add tag-triggered release workflow with portable binary packaging#77
particlesector merged 1 commit into
mainfrom
claude/ci-release-build-workflow-zahlnf

Conversation

@particlesector

@particlesector particlesector commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds .github/workflows/release.yml: pushing a version tag (v[0-9]+.[0-9]+.[0-9]+*) builds Windows (MSVC 2026) and Linux (GCC) binaries using the same build recipe as ci.yml, runs the test suite, cmake --installs each into a relocatable bin/ + share/chiselcad/{shaders,resources} layout, packages each as a zip/tarball, and publishes both to a GitHub Release named after the tag.
  • Fixes a bug that would have made those release binaries unusable: CHISELCAD_SHADER_DIR/CHISELCAD_RESOURCE_DIR were baked in at compile time as absolute paths into the CI checkout tree, so a binary zipped up from CI and run on any other machine would fail to find its shaders/fonts.
    • Adds src/util/ResourcePaths.{h,cpp} with Win32/Posix executable-path backends, which resolve shader/resource directories relative to the running executable (preferring the installed share/chiselcad/ layout) and fall back to the old compile-time paths for in-place dev builds.
    • Application.cpp / CsgEvaluator.cpp now go through this resolver instead of the raw CHISELCAD_SHADER_DIR/CHISELCAD_RESOURCE_DIR macros.
    • Pipeline.cpp's shader path building switched from string concatenation (which relied on a trailing-slash convention) to std::filesystem::path joins.
    • CMakeLists.txt wires the new sources into both the chiselcad and chiselcad_tests targets.
    • Windows packaging also copies the DLLs vcpkg's dynamic triplet drops next to the built exe (cmake --install doesn't do this automatically); Linux's static triplet needs no extra step.

Test plan

  • CI (ci.yml) passes on this branch (Windows + Linux build/test)
  • Push a vX.Y.Z tag against this branch (or after merge) and confirm release.yml produces a Windows zip and a Linux tarball and attaches both to a GitHub Release
  • Unzip/untar each archive on a clean machine and confirm the app launches and finds its shaders/fonts (i.e. bin/chiselcad(.exe) next to share/chiselcad/{shaders,resources} resolves correctly)

Generated by Claude Code

Adds .github/workflows/release.yml: pushing a version tag (v*.*.*) builds
Windows and Linux binaries (reusing ci.yml's build recipe), installs them
into a relocatable bin/+share/chiselcad/ layout, packages each as a zip/
tarball, and publishes them to a GitHub Release via gh CLI.

The install layout only works if the binary can find its shaders/fonts
without the compile-time absolute build-tree paths baked in by CI, so this
also adds src/util/ResourcePaths (with Win32/POSIX executable-path
backends): it resolves shader/resource directories relative to the running
executable first, falling back to the old compile-time paths for in-place
dev builds. Application.cpp and CsgEvaluator.cpp now go through it instead
of using CHISELCAD_SHADER_DIR/CHISELCAD_RESOURCE_DIR directly, and
Pipeline.cpp's shader path joining was switched from raw string
concatenation to std::filesystem::path so it doesn't depend on a trailing
slash convention.

@particlesector particlesector left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. This is solid — I traced the actual bug carefully:

  • install(DIRECTORY ${SHADER_BINARY_DIR} DESTINATION share/chiselcad) (no trailing slash) installs to share/chiselcad/shaders/*.spv, and install(DIRECTORY resources/ DESTINATION share/chiselcad/resources) (trailing slash) installs contents directly to share/chiselcad/resources/*. Both match installedCandidate()'s exeDir/../share/chiselcad/{shaders,resources} exactly — the runtime resolver lines up with the existing install rules.
  • The Pipeline.cpp switch from string concat to std::filesystem::path joins correctly fixes the trailing-slash assumption.
  • release.yml's Windows/Linux job config (runner labels, Vulkan SDK version, vcpkg commit) matches ci.yml exactly, as claimed.
  • ResourcePathsPosix.cpp's __linux__-only guard mirrors the existing FileWatcherInotify.cpp convention (UNIX == Linux in this project), so it's not a new gap.

One minor, non-blocking observation: in resolveShaderDir()/resolveResourceDir(), if a stale share/chiselcad/ directory ever ends up next to a dev build (e.g. from an errant local cmake --install), it'll silently win over the live build-tree shaders since exists() is the only check. Unlikely in practice given the CI install prefix is install/, not worth changing.

Approving.


Generated by Claude Code

@particlesector
particlesector merged commit db0ff98 into main Jul 17, 2026
4 checks passed
@particlesector
particlesector deleted the claude/ci-release-build-workflow-zahlnf branch July 17, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants