From 5e7708d6a20387aa2de0208e4a98747c0231a9f5 Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Tue, 26 Nov 2024 18:01:32 +0900 Subject: [PATCH 1/9] Adding gnocontribs image build --- .github/goreleaser.yaml | 63 ++++++++++++++++---------- .github/workflows/releaser-nightly.yml | 2 +- Dockerfile.release | 19 ++++---- 3 files changed, 52 insertions(+), 32 deletions(-) diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index b5fb07d0578..8ff3133fc02 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -86,6 +86,7 @@ builds: goarm: - "6" - "7" + # Gno Contribs - id: gnobro dir: ./contribs/gnodev/cmd/gnobro binary: gnobro @@ -101,6 +102,21 @@ builds: goarm: - "6" - "7" + - id: gnogenesis + dir: ./contribs/gnogenesis + binary: gnogenesis + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - arm + goarm: + - "6" + - "7" gomod: proxy: true @@ -300,6 +316,7 @@ dockers: - gno.land/genesis/genesis_txs.jsonl - examples - gnovm/stdlibs + # gnokey - use: buildx dockerfile: Dockerfile.release @@ -504,19 +521,19 @@ dockers: ids: - gnofaucet - # gnobro + # gnocontribs - use: buildx dockerfile: Dockerfile.release goos: linux goarch: amd64 image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-amd64" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64" build_flag_templates: - "--target=gnobro" - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: @@ -526,17 +543,17 @@ dockers: goos: linux goarch: arm64 image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-arm64v8" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-arm64v8" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-arm64v8" build_flag_templates: - - "--target=gnobro" + - "--target=gnocontribs" - "--platform=linux/arm64/v8" - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnobro + - gnocontribs - use: buildx dockerfile: Dockerfile.release goos: linux @@ -645,19 +662,19 @@ docker_manifests: - ghcr.io/gnolang/{{ .ProjectName }}/gnofaucet:{{ .Env.TAG_VERSION }}-armv6 - ghcr.io/gnolang/{{ .ProjectName }}/gnofaucet:{{ .Env.TAG_VERSION }}-armv7 - # gnobro - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv7 + # gnocontribs + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }} + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv7 + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }} + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv7 docker_signs: - cmd: cosign @@ -707,4 +724,4 @@ nightly: git: ignore_tag_prefixes: - - "chain/" + - "chain/ diff --git a/.github/workflows/releaser-nightly.yml b/.github/workflows/releaser-nightly.yml index aed56526a2f..b3f00b4a74a 100644 --- a/.github/workflows/releaser-nightly.yml +++ b/.github/workflows/releaser-nightly.yml @@ -39,7 +39,7 @@ jobs: with: distribution: goreleaser-pro version: ~> v2 - args: release --clean --nightly --snapshot --config ./.github/goreleaser.yaml + args: release --clean --nightly --skip dockerhub --snapshot --config ./.github/goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/Dockerfile.release b/Dockerfile.release index 481100c85c3..85d118377f2 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -44,14 +44,6 @@ COPY ./gnofaucet /usr/bin/gnofaucet EXPOSE 5050 ENTRYPOINT [ "/usr/bin/gnofaucet" ] -# -## ghcr.io/gnolang/gno/gnobro -FROM base as gnobro - -COPY ./gnobro /usr/bin/gnobro -EXPOSE 22 -ENTRYPOINT [ "/usr/bin/gnobro" ] - # ## ghcr.io/gnolang/gno FROM base as gno @@ -62,3 +54,14 @@ COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/ ENTRYPOINT [ "/usr/bin/gno" ] + +# +## ghcr.io/gnolang/gnocontribs +FROM base as gnocontribs + +COPY ./gno /usr/bin/gno +COPY ./examples /gnoroot/examples/ +COPY ./gnobro /usr/bin/gnobro +COPY ./gnogenesis /usr/bin/gnogenesis + +ENTRYPOINT [ "/bin/sh", "-c" ] From 10b14ba7a5a8e099990d51a11fb7bd11861393bb Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Tue, 26 Nov 2024 18:24:34 +0900 Subject: [PATCH 2/9] typo --- .github/goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index 8ff3133fc02..28766abb07c 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -724,4 +724,4 @@ nightly: git: ignore_tag_prefixes: - - "chain/ + - "chain/" From ca4f4faa243881dbc9fe1d580ee301c3080b1cdc Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Tue, 26 Nov 2024 19:13:21 +0900 Subject: [PATCH 3/9] removing explicit gnobro image --- .github/goreleaser.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index 28766abb07c..b35185d2779 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -530,14 +530,14 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64" - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64" build_flag_templates: - - "--target=gnobro" + - "--target=gnocontribs" - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnobro + - gnocontribs - use: buildx dockerfile: Dockerfile.release goos: linux @@ -560,34 +560,34 @@ dockers: goarch: arm goarm: 6 image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv6" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv6" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv6" build_flag_templates: - - "--target=gnobro" + - "--target=gnocontribs" - "--platform=linux/arm/v6" - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnobro + - gnocontribs - use: buildx dockerfile: Dockerfile.release goos: linux goarch: arm goarm: 7 image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv7" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv7" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv7" build_flag_templates: - - "--target=gnobro" + - "--target=gnocontribs" - "--platform=linux/arm/v7" - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnobro + - gnocontribs docker_manifests: # https://goreleaser.com/customization/docker_manifest/ From 1d490a43114a9de6ee8504db5e14937a7d9ac159 Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Wed, 27 Nov 2024 07:29:18 +0900 Subject: [PATCH 4/9] fixing goreleaser image gnocontribs --- .github/goreleaser.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index b35185d2779..9d5c82bb42a 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -87,6 +87,7 @@ builds: - "6" - "7" # Gno Contribs + # NOTE: Contribs binary will be added in a single docker image below: gnocontribs - id: gnobro dir: ./contribs/gnodev/cmd/gnobro binary: gnobro @@ -537,7 +538,8 @@ dockers: - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnocontribs + - gnobro + - gnogenesis - use: buildx dockerfile: Dockerfile.release goos: linux @@ -553,7 +555,8 @@ dockers: - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnocontribs + - gnobro + - gnogenesis - use: buildx dockerfile: Dockerfile.release goos: linux @@ -570,7 +573,8 @@ dockers: - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnocontribs + - gnobro + - gnogenesis - use: buildx dockerfile: Dockerfile.release goos: linux @@ -587,7 +591,8 @@ dockers: - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" ids: - - gnocontribs + - gnobro + - gnogenesis docker_manifests: # https://goreleaser.com/customization/docker_manifest/ From 79618774afebdc095ecad6b47886bdb233cb8d25 Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Wed, 27 Nov 2024 07:36:22 +0900 Subject: [PATCH 5/9] Fixing dockerfile for gnocontribs --- Dockerfile.release | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.release b/Dockerfile.release index 85d118377f2..58429782391 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -59,9 +59,8 @@ ENTRYPOINT [ "/usr/bin/gno" ] ## ghcr.io/gnolang/gnocontribs FROM base as gnocontribs -COPY ./gno /usr/bin/gno -COPY ./examples /gnoroot/examples/ COPY ./gnobro /usr/bin/gnobro COPY ./gnogenesis /usr/bin/gnogenesis +COPY ./examples /gnoroot/examples/ ENTRYPOINT [ "/bin/sh", "-c" ] From 6a374fb0f4903afcd73279c78a63d90f43b55341 Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Wed, 27 Nov 2024 07:41:47 +0900 Subject: [PATCH 6/9] temporary removing extra files --- Dockerfile.release | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.release b/Dockerfile.release index 58429782391..a78aa1a71e8 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -61,6 +61,7 @@ FROM base as gnocontribs COPY ./gnobro /usr/bin/gnobro COPY ./gnogenesis /usr/bin/gnogenesis -COPY ./examples /gnoroot/examples/ +# COPY ./examples /gnoroot/examples/ +# Extrafiles... ENTRYPOINT [ "/bin/sh", "-c" ] From 61bd7ed9628fe6d373862dc762cf32a8e9d50596 Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Wed, 27 Nov 2024 12:33:17 +0900 Subject: [PATCH 7/9] adding extrafiles to gnocontribs, fixing goreleaser pro schema errors --- .github/goreleaser.yaml | 21 +++++++++++++++++++++ Dockerfile.release | 29 ++++++++++++++++------------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index 9d5c82bb42a..71a8ba98745 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json project_name: gno version: 2 @@ -540,6 +541,11 @@ dockers: ids: - gnobro - gnogenesis + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs - use: buildx dockerfile: Dockerfile.release goos: linux @@ -557,6 +563,11 @@ dockers: ids: - gnobro - gnogenesis + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs - use: buildx dockerfile: Dockerfile.release goos: linux @@ -575,6 +586,11 @@ dockers: ids: - gnobro - gnogenesis + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs - use: buildx dockerfile: Dockerfile.release goos: linux @@ -593,6 +609,11 @@ dockers: ids: - gnobro - gnogenesis + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs docker_manifests: # https://goreleaser.com/customization/docker_manifest/ diff --git a/Dockerfile.release b/Dockerfile.release index a78aa1a71e8..6fc1dc81d05 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -11,11 +11,11 @@ CMD [ "" ] ## ghcr.io/gnolang/gno/gnoland FROM base as gnoland -COPY ./gnoland /usr/bin/gnoland -COPY ./examples /gnoroot/examples/ -COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ -COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt -COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl +COPY ./gnoland /usr/bin/gnoland +COPY ./examples /gnoroot/examples/ +COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ +COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt +COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl EXPOSE 26656 26657 @@ -48,10 +48,10 @@ ENTRYPOINT [ "/usr/bin/gnofaucet" ] ## ghcr.io/gnolang/gno FROM base as gno -COPY ./gno /usr/bin/gno -COPY ./examples /gnoroot/examples/ -COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ -COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/ +COPY ./gnobro /usr/bin/gno +COPY ./examples /gnoroot/examples/ +COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ +COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/ ENTRYPOINT [ "/usr/bin/gno" ] @@ -59,9 +59,12 @@ ENTRYPOINT [ "/usr/bin/gno" ] ## ghcr.io/gnolang/gnocontribs FROM base as gnocontribs -COPY ./gnobro /usr/bin/gnobro -COPY ./gnogenesis /usr/bin/gnogenesis -# COPY ./examples /gnoroot/examples/ -# Extrafiles... +COPY ./gnobro /usr/bin/gnobro +COPY ./gnogenesis /usr/bin/gnogenesis +COPY ./examples /gnoroot/examples/ +COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ +COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt +COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl +EXPOSE 22 ENTRYPOINT [ "/bin/sh", "-c" ] From d0cbc2f90cca7f7b812cc59846f79bef764facdf Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Wed, 27 Nov 2024 12:56:48 +0900 Subject: [PATCH 8/9] typo --- Dockerfile.release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.release b/Dockerfile.release index 6fc1dc81d05..c7bb1b582ed 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -48,7 +48,7 @@ ENTRYPOINT [ "/usr/bin/gnofaucet" ] ## ghcr.io/gnolang/gno FROM base as gno -COPY ./gnobro /usr/bin/gno +COPY ./gno /usr/bin/gno COPY ./examples /gnoroot/examples/ COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/ From 87b50f3e3d32b35da1586f1faa99bc4068f6676e Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Wed, 27 Nov 2024 13:19:40 +0900 Subject: [PATCH 9/9] restore nightly --- .github/workflows/releaser-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releaser-nightly.yml b/.github/workflows/releaser-nightly.yml index b3f00b4a74a..aed56526a2f 100644 --- a/.github/workflows/releaser-nightly.yml +++ b/.github/workflows/releaser-nightly.yml @@ -39,7 +39,7 @@ jobs: with: distribution: goreleaser-pro version: ~> v2 - args: release --clean --nightly --skip dockerhub --snapshot --config ./.github/goreleaser.yaml + args: release --clean --nightly --snapshot --config ./.github/goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}