feat: composite actions generation + tag-based publishing#1
Merged
Conversation
…ription kind-agnostic
…s as first consumer
Define the discriminated actionType (runs.using enum, composite-only for now) with input/output submodules, reusing the existing stepType.
…e steps Add actionToYaml (dispatching on runs.using) and compositeStepToYaml, which reuses stepToYaml and defaults shell to bash on composite run steps as GitHub requires.
Add actions/actionFiles/actionsDir options mirroring the workflows pipeline. Each action emits .github/actions/<name>/action.yml via a directory-per-action derivation. Non-breaking: workflows output unchanged.
Exercise the actions option end-to-end with inputs, outputs, and a run step, verifying shell: bash defaulting on composite run steps.
Add a Composite Actions section, module option reference entries for actions/actionsDir/actionFiles, an example link, and a feature bullet.
Gate the reusable workflow's visibility input on tag refs so pushes to master build and check without cutting a rolling release; v* tags publish the tag's SemVer version. Tighten the tag glob to require a leading v, as flakehub-push requires v-prefixed SemVer tags. Regenerate ci.yml.
The design and implementation plan remain in git history; drop them from the working tree now that the feature has shipped to avoid repo clutter.
Collapse the repeated githubActions.* keys in the config return into a single nested attrset to satisfy statix W20 (avoid repeated keys).
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
Adds a
githubActions.actionsoption that generates GitHub composite actions to.github/actions/<name>/action.yml, mirroring the existingworkflowspipeline. Also switches FlakeHub publishing from rolling auto-bump to version tags.This is additive and non-breaking: existing
workflows/workflowFiles/workflowsDiroutput is byte-identical before and after (verified).Composite actions
modules/types/action.nix— newactionType, discriminated onruns.using(an enum currently containing only"composite"), withinputs/outputssubmodules. Reuses the existingstepType. Designed so future kinds (docker, node, Nix-built JS) slot in additively: a new enum value + converter case.modules/converters.nix—actionToYaml(dispatches onruns.using) andcompositeStepToYaml, which reusesstepToYamland defaultsshell: bashon compositerunsteps (GitHub requires it).modules/github-ci.nix— newactionsoption plus read-onlyactionFiles(attrsOf package, keyed<name>/action.yml) andactionsDir(directory-per-action derivation).examples/composite-action/— end-to-end example with inputs, outputs, and a run step.CI: tag-based publishing
The
DeterminateSystems/cireusable workflow publishes whenevervisibilityis non-empty (on the default branch or a tag). Previously everymasterpush cut a rolling release (thev0.1.xauto-bump).visibilityis now gated on tag refs:${{ startsWith(github.ref, 'refs/tags/') && 'public' || '' }}. master/PR runs build + check without publishing;v*tags publish the tag's SemVer version.v[0-9]+.[0-9]+.[0-9]+*(flakehub-push requires a leadingv)..github/workflows/ci.yml.Verification
nix flake checkpasses;actionlinton the regeneratedci.ymlis clean;statixclean.setup-ci/action.ymlasserts:runs.using: composite,runstepshell: bashdefaulted,inputs.node-version.default: "20",outputs.cache-hit.valueround-trips.flake-checker,update-flake-lock) byte-identical to baseline; onlyci.ymlchanged.Notes
docs/were removed in a dedicated commit; they remain in git history.v0.2.0(minor bump for additive feature) onmasterafter merge.