Skip to content

Commit

Permalink
Merge branch 'master' into dev/zivkovicmilos/bootnodes
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Nov 29, 2024
2 parents 67749b1 + 97b2159 commit 6ad9353
Show file tree
Hide file tree
Showing 519 changed files with 9,544 additions and 5,334 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
1 change: 1 addition & 0 deletions .github/workflows/autocounterd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
paths:
- misc/autocounterd
- misc/loop
- .github/workflows/autocounterd.yml
branches:
- "master"
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: GitHub Bot

on:
# Watch for changes on PR state, assignees, labels, head branch and draft/ready status
pull_request_target:
types:
- assigned
- unassigned
- labeled
- unlabeled
- opened
- reopened
- synchronize # PR head updated
- converted_to_draft
- ready_for_review

# Watch for changes on PR comment
issue_comment:
types: [created, edited, deleted]

# Manual run from GitHub Actions interface
workflow_dispatch:
inputs:
pull-request-list:
description: "PR(s) to process: specify 'all' or a comma separated list of PR numbers, e.g. '42,1337,7890'"
required: true
default: all
type: string

jobs:
# This job creates a matrix of PR numbers based on the inputs from the various
# events that can trigger this workflow so that the process-pr job below can
# handle the parallel processing of the pull-requests
define-prs-matrix:
name: Define PRs matrix
# Prevent bot from retriggering itself
if: ${{ github.actor != vars.GH_BOT_LOGIN }}
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
pr-numbers: ${{ steps.pr-numbers.outputs.pr-numbers }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: contribs/github-bot/go.mod

- name: Generate matrix from event
id: pr-numbers
working-directory: contribs/github-bot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "pr-numbers=$(go run . matrix)" >> "$GITHUB_OUTPUT"

# This job processes each pull request in the matrix individually while ensuring
# that a same PR cannot be processed concurrently by mutliple runners
process-pr:
name: Process PR
needs: define-prs-matrix
runs-on: ubuntu-latest
strategy:
matrix:
# Run one job for each PR to process
pr-number: ${{ fromJSON(needs.define-prs-matrix.outputs.pr-numbers) }}
concurrency:
# Prevent running concurrent jobs for a given PR number
group: ${{ matrix.pr-number }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: contribs/github-bot/go.mod

- name: Run GitHub Bot
working-directory: contribs/github-bot
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_PAT }}
run: go run . check -pr-numbers '${{ matrix.pr-number }}' -verbose
6 changes: 3 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: examples
on:
pull_request:
push:
branches: [ "master" ]
branches: ["master"]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goversion: [ "1.22.x" ]
goversion: ["1.22.x"]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -86,7 +86,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.22.x" ]
go-version: ["1.22.x"]
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/genesis-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: genesis-verify

on:
pull_request:
branches:
- master
paths:
- "misc/deployments/**/genesis.json"
- ".github/workflows/genesis-verify.yml"

jobs:
verify:
strategy:
fail-fast: false
matrix:
testnet: ["test5.gno.land"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: "misc/deployments/${{ matrix.testnet }}/genesis.json"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Build gnogenesis
run: make -C contribs/gnogenesis

- name: Verify each genesis file
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Verifying $file"
gnogenesis verify -genesis-path $file
done
- name: Build gnoland
run: make -C gno.land install.gnoland

- name: Running latest gnoland with each genesis file
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Running gnoland with $file"
timeout 60s gnoland start -lazy --genesis $file || exit_code=$?
if [ $exit_code -eq 124 ]; then
echo "Gnoland genesis state generated successfully"
else
echo "Gnoland failed to start with $file"
exit 1
fi
done
2 changes: 2 additions & 0 deletions .github/workflows/gnovm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
uses: ./.github/workflows/main_template.yml
with:
modulepath: "gnovm"
# in pull requests, append -short so that the CI runs quickly.
tests-extra-args: ${{ github.event_name == 'pull_request' && '-short' || '' }}
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
fmt:
Expand Down
Loading

0 comments on commit 6ad9353

Please sign in to comment.