diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml new file mode 100644 index 00000000000..bffbf9fb0d6 --- /dev/null +++ b/.github/goreleaser.yaml @@ -0,0 +1,481 @@ +project_name: gno + +before: + hooks: + - go mod tidy + +builds: + - id: gno + main: ./gnovm/cmd/gno + binary: gno + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - arm + goarm: + - 6 + - 7 + - id: gnoland + main: ./gno.land/cmd/gnoland + binary: gnoland + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - arm + goarm: + - 6 + - 7 + - id: gnokey + main: ./gno.land/cmd/gnokey + binary: gnokey + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - arm + goarm: + - 6 + - 7 + - id: gnoweb + main: ./gno.land/cmd/gnoweb + binary: gnoweb + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - arm + goarm: + - 6 + - 7 +gomod: + proxy: true + +archives: + # https://goreleaser.com/customization/archive/ + - files: + # Standard Release Files + - LICENSE.md + - README.md + +signs: + - cmd: cosign + env: + - COSIGN_EXPERIMENTAL=1 + certificate: '${artifact}.pem' + args: + - sign-blob + - '--output-certificate=${certificate}' + - '--output-signature=${signature}' + - '${artifact}' + - "--yes" # needed on cosign 2.0.0+ + artifacts: checksum + output: true + +dockers: + # https://goreleaser.com/customization/docker/ + + # gno + - use: buildx + dockerfile: Dockerfile.gno.release + goos: linux + goarch: amd64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64" + - "ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64" + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gno + extra_files: + - examples + - gnovm/stdlibs + - gnovm/tests/stdlibs + - use: buildx + dockerfile: Dockerfile.gno.release + goos: linux + goarch: arm64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8" + - "ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8" + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gno + extra_files: + - examples + - gnovm/stdlibs + - gnovm/tests/stdlibs + - use: buildx + dockerfile: Dockerfile.gno.release + goos: linux + goarch: arm + goarm: 6 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6" + - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6" + build_flag_templates: + - "--platform=linux/arm/v6" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gno + extra_files: + - examples + - gnovm/stdlibs + - gnovm/tests/stdlibs + - use: buildx + dockerfile: Dockerfile.gno.release + goos: linux + goarch: arm + goarm: 7 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7" + - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7" + build_flag_templates: + - "--platform=linux/arm/v7" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gno + extra_files: + - examples + - gnovm/stdlibs + - gnovm/tests/stdlibs + + # gnoland + - use: buildx + dockerfile: Dockerfile.gnoland.release + goos: linux + goarch: amd64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-amd64" + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoland + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs + - use: buildx + dockerfile: Dockerfile.gnoland.release + goos: linux + goarch: arm64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-arm64v8" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-arm64v8" + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoland + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs + - use: buildx + dockerfile: Dockerfile.gnoland.release + goos: linux + goarch: arm + goarm: 6 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv6" + build_flag_templates: + - "--platform=linux/arm/v6" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoland + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs + - use: buildx + dockerfile: Dockerfile.gnoland.release + goos: linux + goarch: arm + goarm: 7 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv7" + build_flag_templates: + - "--platform=linux/arm/v7" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoland + extra_files: + - gno.land/genesis/genesis_balances.txt + - gno.land/genesis/genesis_txs.jsonl + - examples + - gnovm/stdlibs + # gnokey + - use: buildx + dockerfile: Dockerfile.gnokey.release + goos: linux + goarch: amd64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-amd64" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-amd64" + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnokey + - use: buildx + dockerfile: Dockerfile.gnokey.release + goos: linux + goarch: arm64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-arm64v8" + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnokey + - use: buildx + dockerfile: Dockerfile.gnokey.release + goos: linux + goarch: arm + goarm: 6 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv6" + build_flag_templates: + - "--platform=linux/arm/v6" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnokey + - use: buildx + dockerfile: Dockerfile.gnokey.release + goos: linux + goarch: arm + goarm: 7 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv7" + build_flag_templates: + - "--platform=linux/arm/v7" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnokey + + # gnoweb + - use: buildx + dockerfile: Dockerfile.gnoweb.release + goos: linux + goarch: amd64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-amd64" + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoweb + - use: buildx + dockerfile: Dockerfile.gnoweb.release + goos: linux + goarch: arm64 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-arm64v8" + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoweb + - use: buildx + dockerfile: Dockerfile.gnoweb.release + goos: linux + goarch: arm + goarm: 6 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv6" + build_flag_templates: + - "--platform=linux/arm/v6" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoweb + - use: buildx + dockerfile: Dockerfile.gnoweb.release + goos: linux + goarch: arm + goarm: 7 + image_templates: + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7" + - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv7" + build_flag_templates: + - "--platform=linux/arm/v7" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + ids: + - gnoweb + +docker_manifests: + # https://goreleaser.com/customization/docker_manifest/ + + # gno + - name_template: ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }} + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7 + - name_template: ghcr.io/gnolang/{{ .ProjectName }}:latest + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7 + + # gnoland + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }} + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7 + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv7 + + # gnokey + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }} + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7 + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv7 + + # gnoweb + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }} + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7 + - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest + image_templates: + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-amd64 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-arm64v8 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv6 + - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv7 + +docker_signs: + - cmd: cosign + env: + - COSIGN_EXPERIMENTAL=1 + artifacts: images + output: true + args: + - 'sign' + - '${artifact}' + - "--yes" # needed on cosign 2.0.0+ + +checksum: + name_template: 'checksums.txt' + +changelog: + sort: asc + +source: + enabled: true + +sboms: + - artifacts: archive + - id: source # Two different sbom configurations need two different IDs + artifacts: source + +release: + draft: true + replace_existing_draft: true + prerelease: auto + mode: append + footer: | + ### Container Images + + You can find all docker images at: + + https://github.com/orgs/gnolang/packages?repo_name={{ .ProjectName }} + diff --git a/.github/workflows/DELETEdocker.yml b/.github/workflows/DELETEdocker.yml deleted file mode 100644 index 374eab763c9..00000000000 --- a/.github/workflows/DELETEdocker.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: docker -on: - push: - branches: [ "master" ] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - build-main: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Get commit SHA - id: commit - run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - if: (github.event_name != 'pull_request') - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: | - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.commit.outputs.sha }} - - build-slim: - runs-on: ubuntu-latest - strategy: - matrix: - target: [ gnoland-slim, gnokey-slim, gno-slim, gnofaucet-slim, gnoweb-slim ] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Get commit SHA - id: commit - run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - if: (github.event_name != 'pull_request') - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64,linux/arm64 - target: ${{ matrix.target }} - push: ${{ github.event_name != 'pull_request' }} - tags: | - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:latest - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:${{ steps.commit.outputs.sha }} diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml new file mode 100644 index 00000000000..b16c358522b --- /dev/null +++ b/.github/workflows/nightlies.yml @@ -0,0 +1,50 @@ +name: Trigger nightly build + +on: + schedule: + - cron: '0 0 * * 2-6' + workflow_dispatch: + +jobs: + trigger-nightly: + name: Push tag for nightly build + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + - name: 'Push new tag' + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + # A previous release was created using a lightweight tag + # git describe by default includes only annotated tags + # git describe --tags includes lightweight tags as well + DESCRIBE=`git tag -l --sort=-v:refname | grep -v nightly | head -n 1` + MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` + MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` + MINOR_VERSION="$((${MINOR_VERSION} + 1))" + TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d')" + git tag -a $TAG -m "$TAG: nightly build" + git push origin $TAG + - name: 'Clean up nightly releases' + uses: dev-drprasad/delete-older-releases@v0.3.3 + with: + keep_latest: 5 + delete_tags: true + delete_tag_pattern: nightly + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: 'Delete nightly containers older than a week' + uses: snok/container-retention-policy@v2.1.2 + with: + image-names: gnolang/gno* + cut-off: 1 week ago UTC + account-type: org + org-name: gnolang + keep-at-least: 5 + token: ${{ secrets.GITHUB_TOKEN }} + filter-tags: '*-nightly*' \ No newline at end of file diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml new file mode 100644 index 00000000000..8baa16254f3 --- /dev/null +++ b/.github/workflows/releaser.yml @@ -0,0 +1,45 @@ +name: Go Releaser + +on: + push: + tags: + - "v*" + +permissions: + contents: write # needed to write releases + id-token: write # needed for keyless signing + packages: write # needed for ghcr access + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v5 + with: + go-version: "1.22.x" + cache: true + + - uses: sigstore/cosign-installer@v3.5.0 + - uses: anchore/sbom-action/download-syft@v0.15.10 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser-pro + version: latest + args: release --clean --config ./.github/goreleaser.yaml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_KEY: ${{ secrets.GORELEASER_TOKEN }} diff --git a/.gitignore b/.gitignore index 0a06c2cf055..019c0be3c98 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ genesis.json # Build leftovers build +dist # Legacy .gitignore data/* diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a18c7125a82..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -# build gno -FROM golang:1.22 AS build-gno -RUN mkdir -p /opt/gno/src /opt/build -WORKDIR /opt/build -ADD go.mod go.sum . -RUN go mod download -ADD . ./ -RUN go build -o ./build/gnoland ./gno.land/cmd/gnoland -RUN go build -o ./build/gnokey ./gno.land/cmd/gnokey -RUN go build -o ./build/gnoweb ./gno.land/cmd/gnoweb -RUN go build -o ./build/gno ./gnovm/cmd/gno -RUN ls -la ./build -ADD . /opt/gno/src/ -RUN rm -rf /opt/gno/src/.git - -# build faucet -FROM golang:1.22 AS build-faucet -RUN mkdir -p /opt/gno/src /opt/build -WORKDIR /opt/build -ADD contribs/gnofaucet/go.mod contribs/gnofaucet/go.sum . -RUN go mod download -ADD contribs/gnofaucet ./ -RUN go build -o ./build/gnofaucet . - - -# runtime-base + runtime-tls -FROM debian:stable-slim AS runtime-base -ENV PATH="${PATH}:/opt/gno/bin" \ - GNOROOT="/opt/gno/src" -WORKDIR /opt/gno/src -FROM runtime-base AS runtime-tls -RUN apt-get update && apt-get install -y expect ca-certificates && update-ca-certificates - -# slim images -FROM runtime-base AS gnoland-slim -WORKDIR /opt/gno/src/gno.land/ -COPY --from=build-gno /opt/build/build/gnoland /opt/gno/bin/ -ENTRYPOINT ["gnoland"] -EXPOSE 26657 36657 - -FROM runtime-base AS gnokey-slim -COPY --from=build-gno /opt/build/build/gnokey /opt/gno/bin/ -ENTRYPOINT ["gnokey"] - -FROM runtime-base AS gno-slim -COPY --from=build-gno /opt/build/build/gno /opt/gno/bin/ -ENTRYPOINT ["gno"] - -FROM runtime-tls AS gnofaucet-slim -COPY --from=build-faucet /opt/build/build/gnofaucet /opt/gno/bin/ -ENTRYPOINT ["gnofaucet"] -EXPOSE 5050 - -FROM runtime-tls AS gnoweb-slim -COPY --from=build-gno /opt/build/build/gnoweb /opt/gno/bin/ -COPY --from=build-gno /opt/gno/src/gno.land/cmd/gnoweb /opt/gno/src/gnoweb -ENTRYPOINT ["gnoweb"] -EXPOSE 8888 - -# all, contains everything. -FROM runtime-tls AS all -COPY --from=build-gno /opt/build/build/* /opt/gno/bin/ -COPY --from=build-faucet /opt/build/build/* /opt/gno/bin/ -COPY --from=build-gno /opt/gno/src /opt/gno/src -# gofmt is required by `gnokey maketx addpkg` -COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin diff --git a/Dockerfile.gno.release b/Dockerfile.gno.release new file mode 100644 index 00000000000..874d427661f --- /dev/null +++ b/Dockerfile.gno.release @@ -0,0 +1,11 @@ +FROM busybox + +COPY ./gno /gno +COPY ./examples /gnoroot/examples/ +COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ +COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/ + +ENV GNOROOT="/gnoroot/" + +ENTRYPOINT [ "/gno" ] +CMD [ "" ] \ No newline at end of file diff --git a/Dockerfile.gnokey.release b/Dockerfile.gnokey.release new file mode 100644 index 00000000000..4261f9272d6 --- /dev/null +++ b/Dockerfile.gnokey.release @@ -0,0 +1,6 @@ +FROM busybox + +COPY . / + +ENTRYPOINT [ "/gnokey" ] +CMD [ "" ] \ No newline at end of file diff --git a/Dockerfile.gnoland.release b/Dockerfile.gnoland.release new file mode 100644 index 00000000000..f8bd321f67f --- /dev/null +++ b/Dockerfile.gnoland.release @@ -0,0 +1,13 @@ +FROM busybox + +COPY ./gnoland /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 + +ENV GNOROOT="/gnoroot/" + +EXPOSE 26657 36657 +ENTRYPOINT [ "/gnoland" ] +CMD [ "" ] \ No newline at end of file diff --git a/Dockerfile.gnoweb.release b/Dockerfile.gnoweb.release new file mode 100644 index 00000000000..9bdfd8ddce2 --- /dev/null +++ b/Dockerfile.gnoweb.release @@ -0,0 +1,7 @@ +FROM busybox + +COPY . / + +EXPOSE 8888 +ENTRYPOINT [ "/gnoweb" ] +CMD [ "" ] \ No newline at end of file diff --git a/gnovm/tests/imports.go b/gnovm/tests/imports.go index d5541fb0554..befaec7d026 100644 --- a/gnovm/tests/imports.go +++ b/gnovm/tests/imports.go @@ -258,16 +258,16 @@ func TestStore(rootDir, filesPath string, stdin io.Reader, stdout, stderr io.Wri pkg.DefineGoNativeValue("Pi", math.Pi) pkg.DefineGoNativeValue("MaxFloat32", math.MaxFloat32) pkg.DefineGoNativeValue("MaxFloat64", math.MaxFloat64) - pkg.DefineGoNativeValue("MaxUint32", math.MaxUint32) + pkg.DefineGoNativeValue("MaxUint32", uint32(math.MaxUint32)) pkg.DefineGoNativeValue("MaxUint64", uint64(math.MaxUint64)) pkg.DefineGoNativeValue("MinInt8", math.MinInt8) pkg.DefineGoNativeValue("MinInt16", math.MinInt16) pkg.DefineGoNativeValue("MinInt32", math.MinInt32) - pkg.DefineGoNativeValue("MinInt64", math.MinInt64) + pkg.DefineGoNativeValue("MinInt64", int64(math.MinInt64)) pkg.DefineGoNativeValue("MaxInt8", math.MaxInt8) pkg.DefineGoNativeValue("MaxInt16", math.MaxInt16) pkg.DefineGoNativeValue("MaxInt32", math.MaxInt32) - pkg.DefineGoNativeValue("MaxInt64", math.MaxInt64) + pkg.DefineGoNativeValue("MaxInt64", int64(math.MaxInt64)) return pkg, pkg.NewPackage() case "math/rand": // XXX only expose for tests.