Skip to content

Commit

Permalink
Revert "internal/ci: remove workflow files pre generate"
Browse files Browse the repository at this point in the history
This reverts commit f723eb7.

Reason for revert: automated submit went wrong and submitted CLs out of
order breaking the submission of the chain.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I8e4ffd97b9652502596977e7173e390f939f603e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551620
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
myitcv committed Mar 26, 2023
1 parent ee7509f commit 0d89b9b
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions internal/ci/ci_tool.cue
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,14 @@ _goos: string @tag(os,var=os)
// See internal/ci/gen.go for details on how this step fits into the sequence
// of generating our CI workflow definitions, and updating various txtar tests
// with files from that process.
command: gen: {
_dir: path.FromSlash("../../.github/workflows", path.Unix)

workflows: {
remove: {
glob: file.Glob & {
glob: path.Join([_dir, "*.yml"], _goos)
files: [...string]
}
for _, _filename in glob.files {
"delete \(_filename)": file.RemoveAll & {
path: _filename
}
}
}
for _workflowName, _workflow in github.workflows {
let _filename = _workflowName + ".yml"
"generate \(_filename)": file.Create & {
$after: [ for v in remove {v}]
filename: path.Join([_dir, _filename], _goos)
let donotedit = base.#doNotEditMessage & {#generatedBy: "internal/ci/ci_tool.cue", _}
contents: "# \(donotedit)\n\n\(yaml.Marshal(_workflow))"
}
command: gen: workflows: {
for _workflowName, _workflow in github.workflows {
let _filename = _workflowName + ".yml"
(_filename): file.Create & {
_dir: path.FromSlash("../../.github/workflows", path.Unix)
filename: path.Join([_dir, _filename], _goos)
let donotedit = base.#doNotEditMessage & {#generatedBy: "internal/ci/ci_tool.cue", _}
contents: "# \(donotedit)\n\n\(yaml.Marshal(_workflow))"
}
}
}
Expand Down

0 comments on commit 0d89b9b

Please sign in to comment.