diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c42fd4..89841d9 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.1 with: - forge_version: 0.2.0 \ No newline at end of file + forge_version: 0.4.0 \ No newline at end of file diff --git a/blueprint.cue b/blueprint.cue index 5f70ebd..58cae96 100644 --- a/blueprint.cue +++ b/blueprint.cue @@ -1,21 +1,18 @@ version: "1.0" -global: ci: { - local: [ - "^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" +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" } } 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..7f35dbb 100644 --- a/examples/go/blueprint.cue +++ b/examples/go/blueprint.cue @@ -2,18 +2,18 @@ version: "1.0.0" project: { name: "go" ci: targets: { - publish: { + docker: { 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", "linux/arm64", ] } - release: { + github: { 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", @@ -23,4 +23,26 @@ project: { ] } } + release: { + docker: { + on: { + 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/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..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", @@ -20,4 +20,26 @@ project: { privileged: true } } + release: { + docker: { + on: { + 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/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..2961a80 100644 --- a/users/jmgilman/blueprint.cue +++ b/users/jmgilman/blueprint.cue @@ -1,4 +1,26 @@ version: "1.0.0" project: { name: "hello" + release: { + docker: { + on: { + 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" + } + } + } + } }