From 6a74b1e790aadbbce37881d17f1fd0eea6909ce7 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 21 Oct 2024 08:03:11 -0700 Subject: [PATCH 1/6] chore: updates CI to latest version --- .github/workflows/ci.yml | 5 +++-- examples/go/Earthfile | 4 ++-- examples/go/blueprint.cue | 17 +++++++++++++++++ examples/rust/Earthfile | 4 ++-- examples/rust/blueprint.cue | 17 +++++++++++++++++ users/jmgilman/Earthfile | 4 ++-- users/jmgilman/blueprint.cue | 17 +++++++++++++++++ 7 files changed, 60 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c42fd4..b8bf076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ name: CI on: push: branches: [master] + tags: ['**'] pull_request: permissions: @@ -11,6 +12,6 @@ permissions: packages: write jobs: ci: - uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.1.0 + uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.2.0 with: - forge_version: 0.2.0 \ No newline at end of file + forge_version: 0.3.0 \ No newline at end of file diff --git a/examples/go/Earthfile b/examples/go/Earthfile index b27859e..b520deb 100644 --- a/examples/go/Earthfile +++ b/examples/go/Earthfile @@ -43,7 +43,7 @@ test: RUN go test ./... -release: +github: FROM scratch ARG version="v0.0.0" @@ -61,7 +61,7 @@ release: SAVE ARTIFACT bin/hello hello -publish: +docker: FROM debian:bookworm-slim WORKDIR /workspace diff --git a/examples/go/blueprint.cue b/examples/go/blueprint.cue index 8a9ac1e..bc33cfc 100644 --- a/examples/go/blueprint.cue +++ b/examples/go/blueprint.cue @@ -23,4 +23,21 @@ project: { ] } } + release: { + docker: { + on: { + merge: {} + tag: {} + } + } + github: { + on: tag: {} + config: { + token: { + provider: "env" + path: "GITHUB_TOKEN" + } + } + } + } } diff --git a/examples/rust/Earthfile b/examples/rust/Earthfile index 4b750ac..e87840e 100644 --- a/examples/rust/Earthfile +++ b/examples/rust/Earthfile @@ -32,7 +32,7 @@ build: SAVE ARTIFACT ./target/${TARGET}/release/hello hello -release: +github: FROM scratch ARG TARGETOS @@ -47,7 +47,7 @@ release: SAVE ARTIFACT bin/hello hello -publish: +docker: FROM debian:bookworm-slim WORKDIR /workspace diff --git a/examples/rust/blueprint.cue b/examples/rust/blueprint.cue index 2f67161..01706e0 100644 --- a/examples/rust/blueprint.cue +++ b/examples/rust/blueprint.cue @@ -20,4 +20,21 @@ project: { privileged: true } } + release: { + docker: { + on: { + merge: {} + tag: {} + } + } + github: { + on: tag: {} + config: { + token: { + provider: "env" + path: "GITHUB_TOKEN" + } + } + } + } } diff --git a/users/jmgilman/Earthfile b/users/jmgilman/Earthfile index 031296b..81e4568 100644 --- a/users/jmgilman/Earthfile +++ b/users/jmgilman/Earthfile @@ -45,7 +45,7 @@ test: RUN uv sync --frozen --extra dev RUN uv run pytest . -publish: +docker: FROM python:3.12-slim ARG container=hello @@ -60,7 +60,7 @@ publish: ENTRYPOINT ["hello"] SAVE IMAGE ${container}:${tag} -release: +github: FROM scratch COPY +build/dist dist diff --git a/users/jmgilman/blueprint.cue b/users/jmgilman/blueprint.cue index d9809b7..c2e74b9 100644 --- a/users/jmgilman/blueprint.cue +++ b/users/jmgilman/blueprint.cue @@ -1,4 +1,21 @@ version: "1.0.0" project: { name: "hello" + release: { + docker: { + on: { + merge: {} + tag: {} + } + } + github: { + on: tag: {} + config: { + token: { + provider: "env" + path: "GITHUB_TOKEN" + } + } + } + } } From e641c37e80b4f6d30d53c3c0a947c93a9f143544 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 21 Oct 2024 19:40:23 -0700 Subject: [PATCH 2/6] wip: update --- .github/workflows/ci.yml | 4 ++-- examples/go/blueprint.cue | 9 +++++++-- examples/rust/blueprint.cue | 5 +++++ users/jmgilman/blueprint.cue | 5 +++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8bf076..fe024db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,6 @@ permissions: packages: write jobs: ci: - uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.2.0 + uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@master with: - forge_version: 0.3.0 \ No newline at end of file + forge_version: 0.4.0 \ No newline at end of file diff --git a/examples/go/blueprint.cue b/examples/go/blueprint.cue index bc33cfc..9b6a53a 100644 --- a/examples/go/blueprint.cue +++ b/examples/go/blueprint.cue @@ -4,7 +4,7 @@ project: { ci: targets: { publish: { args: { - version: string | *"v0.0.0" @env(name="GIT_TAG",type="string") + version: string | *"v0.0.0" @env(name="GIT_TAG_VERSION",type="string") } platforms: [ "linux/amd64", @@ -13,7 +13,7 @@ project: { } release: { args: { - version: string | *"v0.0.0" @env(name="GIT_TAG",type="string") + version: string | *"v0.0.0" @env(name="GIT_TAG_VERSION",type="string") } platforms: [ "linux/amd64", @@ -29,10 +29,15 @@ project: { merge: {} tag: {} } + config: { + tag: _ @forge(name="GIT_COMMIT_HASH") + } } github: { on: tag: {} config: { + name: string | *"dev" @forge(name="GIT_TAG") + prefix: project.name token: { provider: "env" path: "GITHUB_TOKEN" diff --git a/examples/rust/blueprint.cue b/examples/rust/blueprint.cue index 01706e0..901c832 100644 --- a/examples/rust/blueprint.cue +++ b/examples/rust/blueprint.cue @@ -26,10 +26,15 @@ project: { merge: {} tag: {} } + config: { + tag: _ @forge(name="GIT_COMMIT_HASH") + } } github: { on: tag: {} config: { + name: string | *"dev" @forge(name="GIT_TAG") + prefix: project.name token: { provider: "env" path: "GITHUB_TOKEN" diff --git a/users/jmgilman/blueprint.cue b/users/jmgilman/blueprint.cue index c2e74b9..2961a80 100644 --- a/users/jmgilman/blueprint.cue +++ b/users/jmgilman/blueprint.cue @@ -7,10 +7,15 @@ project: { merge: {} tag: {} } + config: { + tag: _ @forge(name="GIT_COMMIT_HASH") + } } github: { on: tag: {} config: { + name: string | *"dev" @forge(name="GIT_TAG") + prefix: project.name token: { provider: "env" path: "GITHUB_TOKEN" From 84f25e258def2a23765be526bdeae6602b0ce0d9 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 21 Oct 2024 19:42:03 -0700 Subject: [PATCH 3/6] wip: fix --- blueprint.cue | 9 --------- 1 file changed, 9 deletions(-) diff --git a/blueprint.cue b/blueprint.cue index 5f70ebd..0f02a24 100644 --- a/blueprint.cue +++ b/blueprint.cue @@ -4,18 +4,9 @@ global: ci: { "^check.*$", "^build.*$", "^test.*$", - "^release.*$", - "^publish.*$", ] registries: [ "ghcr.io/input-output-hk/catalyst-forge-playground", ] providers: github: registry: "ghcr.io" - tagging: { - aliases: { - "go": "examples/go" - "rust": "examples/rust" - } - strategy: "commit" - } } From e56f48604b72a62419243fcb592da61274726a08 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 21 Oct 2024 19:43:46 -0700 Subject: [PATCH 4/6] wip: fix --- blueprint.cue | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/blueprint.cue b/blueprint.cue index 0f02a24..58cae96 100644 --- a/blueprint.cue +++ b/blueprint.cue @@ -1,12 +1,18 @@ version: "1.0" -global: ci: { - local: [ - "^check.*$", - "^build.*$", - "^test.*$", - ] - registries: [ - "ghcr.io/input-output-hk/catalyst-forge-playground", - ] - providers: github: registry: "ghcr.io" +global: { + ci: { + local: [ + "^check.*$", + "^build.*$", + "^test.*$", + ] + registries: [ + "ghcr.io/input-output-hk/catalyst-forge-playground", + ] + providers: github: registry: "ghcr.io" + } + repo: { + defaultBranch: "master" + name: "input-output-hk/catalyst-forge-playground" + } } From 5026e6e0f94e819d5218d6e5bc25cb8d5deaa3bf Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 21 Oct 2024 19:51:28 -0700 Subject: [PATCH 5/6] wip: fix --- examples/go/blueprint.cue | 4 ++-- examples/rust/blueprint.cue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/go/blueprint.cue b/examples/go/blueprint.cue index 9b6a53a..7f35dbb 100644 --- a/examples/go/blueprint.cue +++ b/examples/go/blueprint.cue @@ -2,7 +2,7 @@ version: "1.0.0" project: { name: "go" ci: targets: { - publish: { + docker: { args: { version: string | *"v0.0.0" @env(name="GIT_TAG_VERSION",type="string") } @@ -11,7 +11,7 @@ project: { "linux/arm64", ] } - release: { + github: { args: { version: string | *"v0.0.0" @env(name="GIT_TAG_VERSION",type="string") } diff --git a/examples/rust/blueprint.cue b/examples/rust/blueprint.cue index 901c832..12cb1d0 100644 --- a/examples/rust/blueprint.cue +++ b/examples/rust/blueprint.cue @@ -5,14 +5,14 @@ project: { build: { privileged: true } - release: { + docker: { platforms: [ "linux/amd64", "linux/arm64", ] privileged: true } - publish: { + github: { platforms: [ "linux/amd64", "linux/arm64", From 8a6ad2ddc5eeccaec2ccf12cd772982514fee8a5 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Mon, 21 Oct 2024 20:14:31 -0700 Subject: [PATCH 6/6] wip: update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe024db..89841d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,6 @@ permissions: packages: write jobs: ci: - uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@master + uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.2.1 with: forge_version: 0.4.0 \ No newline at end of file