Skip to content

feat: composite actions generation + tag-based publishing#1

Merged
typedrat merged 11 commits into
masterfrom
typedrat/composite-actions
Jun 4, 2026
Merged

feat: composite actions generation + tag-based publishing#1
typedrat merged 11 commits into
masterfrom
typedrat/composite-actions

Conversation

@typedrat

@typedrat typedrat commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Adds a githubActions.actions option that generates GitHub composite actions to .github/actions/<name>/action.yml, mirroring the existing workflows pipeline. Also switches FlakeHub publishing from rolling auto-bump to version tags.

This is additive and non-breaking: existing workflows / workflowFiles / workflowsDir output is byte-identical before and after (verified).

Composite actions

  • modules/types/action.nix — new actionType, discriminated on runs.using (an enum currently containing only "composite"), with inputs/outputs submodules. Reuses the existing stepType. Designed so future kinds (docker, node, Nix-built JS) slot in additively: a new enum value + converter case.
  • modules/converters.nixactionToYaml (dispatches on runs.using) and compositeStepToYaml, which reuses stepToYaml and defaults shell: bash on composite run steps (GitHub requires it).
  • modules/github-ci.nix — new actions option plus read-only actionFiles (attrsOf package, keyed <name>/action.yml) and actionsDir (directory-per-action derivation).
  • examples/composite-action/ — end-to-end example with inputs, outputs, and a run step.
  • README — Composite Actions section, module-option reference, example link, feature bullet.

CI: tag-based publishing

The DeterminateSystems/ci reusable workflow publishes whenever visibility is non-empty (on the default branch or a tag). Previously every master push cut a rolling release (the v0.1.x auto-bump).

  • visibility is 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.
  • Tightened the tag glob to v[0-9]+.[0-9]+.[0-9]+* (flakehub-push requires a leading v).
  • Regenerated .github/workflows/ci.yml.

Verification

  • nix flake check passes; actionlint on the regenerated ci.yml is clean; statix clean.
  • Generated setup-ci/action.yml asserts: runs.using: composite, run step shell: bash defaulted, inputs.node-version.default: "20", outputs.cache-hit.value round-trips.
  • Workflow YAML output (flake-checker, update-flake-lock) byte-identical to baseline; only ci.yml changed.

Notes

  • The spec/plan under docs/ were removed in a dedicated commit; they remain in git history.
  • First release will be tagged v0.2.0 (minor bump for additive feature) on master after merge.

typedrat added 11 commits June 3, 2026 18:12
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).
@typedrat typedrat merged commit 9068b31 into master Jun 4, 2026
6 checks passed
@typedrat typedrat deleted the typedrat/composite-actions branch June 4, 2026 01:57
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.

1 participant