feat: add workflow_dispatch for on-demand .sif builds and update to ubuntu-24.04#214
Merged
Conversation
…_only flag Allows manually triggering a .sif build for any OpenStudio version (e.g. 3.10.0 final) without requiring a push to master/develop. - workflow_dispatch inputs: openstudio_version, openstudio_sha, openstudio_version_ext, apptainer_only - apptainer_only=true skips docker build/test, pulling directly from an existing Docker Hub image (nrel/openstudio:<version>) - apptainer job now also runs on workflow_dispatch events - Resolve version inputs step writes dispatch inputs to GITHUB_ENV so empty openstudio_version_ext is handled correctly for final releases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ispatch version inputs
The previous approach used GITHUB_ENV writes to override top-level env: block
vars, but empty string inputs were silently replaced with the input default
value by GitHub before bash ever ran.
Root cause (from research): when gh CLI passes --field key="" or a user
leaves an input blank, GitHub substitutes the input's default: value. Also,
the || operator in GHA expressions treats "" as falsy, so expressions like
${{ inputs.x || env.X }} always fall back to the env: value for empty inputs.
Fix: introduce a setup job that uses GITHUB_OUTPUT to resolve version vars
once in bash (where empty string is genuinely empty), and have docker and
apptainer jobs consume them via needs.setup.outputs. Empty openstudio_version_ext
(= final release) is now handled correctly because:
- input default changed from '-rc1' to '' (so blank input stays blank)
- bash assignment EXT="${{ inputs.openstudio_version_ext }}" with no ||
fallback preserves the empty string in GITHUB_OUTPUT
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…velop Previously the workflow triggered on all pushes AND pull_requests, causing every PR to show duplicate CI checks (one with '(push)' and one with '(pull_request)'). Restricting the push trigger to master/develop means: - PRs: CI runs once via pull_request event - Merges to master/develop: CI runs once via push event - Manual runs: workflow_dispatch still works as before Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
This PR adds the ability to manually trigger Apptainer
.sifbuilds for any OpenStudio version viaworkflow_dispatch, and includes previously-ready ubuntu-24.04 and image tag logic updates.Changes
Workflow dispatch for on-demand
.sifbuilds (docker-openstudio.yml)workflow_dispatchtrigger with inputs:openstudio_version— e.g.3.10.0openstudio_sha— git SHA for the releaseopenstudio_version_ext— e.g.-rc1, or blank for a final releaseapptainer_only— skip docker build/test and pull directly from an existing Docker Hub imagesetupjob that resolves version inputs viaGITHUB_OUTPUT, fixing a subtle GitHub Actions bug where empty string inputs (needed for final releases with no version extension) were silently replaced by the input'sdefault:value before bash ran. UsingGITHUB_OUTPUTinstead ofGITHUB_ENVand avoiding the||operator for the ext variable ensures empty string is preserved correctly.dockerandapptainerjobs now consume resolved versions fromneeds.setup.outputsapptainerjob now runs onworkflow_dispatchevents in addition to pushes tomaster/developubuntu-24.04 runner update and image tag logic
manual_installer_test.ymlanddeploy_docker.shMotivation
The
3.10.0final release.sifwas never uploaded to S3 because the CI run on the release commit failed. This workflow change allows backfilling missed releases without touchingmaster/developdirectly.