Skip to content

Commit

Permalink
feat: Adding an official Gnocontribs image in release process (gnolan…
Browse files Browse the repository at this point in the history
  • Loading branch information
sw360cab authored and r3v4s committed Dec 10, 2024
1 parent c07f2ae commit 83b28d4
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 47 deletions.
103 changes: 73 additions & 30 deletions .github/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
project_name: gno
version: 2

Expand Down Expand Up @@ -86,6 +87,8 @@ builds:
goarm:
- "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
Expand All @@ -101,6 +104,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
Expand Down Expand Up @@ -300,6 +318,7 @@ dockers:
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs

# gnokey
- use: buildx
dockerfile: Dockerfile.release
Expand Down Expand Up @@ -504,73 +523,97 @@ 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"
- "--target=gnocontribs"
- "--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:
- 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
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
- 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
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
- 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
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
- 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/
Expand Down Expand Up @@ -645,19 +688,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
Expand Down
40 changes: 23 additions & 17 deletions Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -44,21 +44,27 @@ 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

COPY ./gno /usr/bin/gno
COPY ./examples /gnoroot/examples/
COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/
COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/
COPY ./gno /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" ]

#
## ghcr.io/gnolang/gnocontribs
FROM base as gnocontribs

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" ]

0 comments on commit 83b28d4

Please sign in to comment.