import "strings" sources: { aquaRegistry: { kind: "json" spec: { // Don't use github_release, we don't want to deal with auth. file: "https://api.github.com/repos/aquaproj/aqua-registry/releases/latest" engine: "dasel/v2" key: "name" } } for _, dep in #values.aquaDeps { let isSourcehut = strings.HasPrefix(dep.name, "sr.ht") if isSourcehut { "aqua_\(dep.name)": { kind: "gittag" spec: { url: "https://git.\(dep.name)" } } } if !isSourcehut { "aqua_\(dep.name)": { kind: "shell" spec: { command: """ aqua g -c \\ <(echo '{registries: [{ type: standard, ref: {{ source `aquaRegistry` }} }]}') \\ \(dep.name) \\ | yq '.[0].name | split("@") | .[1]' """ } } } } } targets: { aquaRegistry: { kind: "yaml" disablesourceinput: true dependson: [ "source#aquaRegistry", // Only update the registry when there's also package updates. for _, dep in #values.aquaDeps {"target#aqua_\(dep.name):or"}, ] dependsonchange: true spec: { file: "aqua.yaml" key: "$.registries[0].ref" value: "{{ source `aquaRegistry` }}" } } for i, dep in #values.aquaDeps { "aqua_\(dep.name)": { kind: "yaml" disablesourceinput: true dependson: ["source#aqua_\(dep.name)"] spec: { file: "aqua.yaml" key: "$.packages[\(i)].name" value: "\(dep.name)@{{ source `aqua_\(dep.name)` }}" } } } aquaChecksums: { kind: "shell" disablesourceinput: true dependson: [for _, dep in #values.aquaDeps {"source#aqua_\(dep.name)"}] spec: command: "aqua upc --prune" changedif: { kind: "file/checksum" spec: files: ["aqua-checksums.json"] } } }