Skip to content

Commit

Permalink
Merge branch 'main' into rp/prototype-fee-refund
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Dec 20, 2023
2 parents c5ec163 + 6e71171 commit 62fb75c
Show file tree
Hide file tree
Showing 103 changed files with 7,352 additions and 574 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,30 +84,21 @@ jobs:
# Generate the release with goreleaser to include pre-built binaries
goreleaser:
needs: version_bump
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
permissions: "write-all"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.1
# Import the GPG key from Github secrets to sign the binaries
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
# Generate the binaries, release, and sign the checksum
- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Create .release-env file
run: |-
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' >> .release-env
- name: Create prebuilt binaries and attach them to the GitHub release
run: make prebuilt-binary
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
timeout-minutes: 8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: technote-space/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: housekeeping
name: pr-review-requester

on:
# pull_request_target is used to allow forks write permissions when running
Expand All @@ -9,8 +9,8 @@ on:
pull_request_target:

jobs:
pr-assignment:
name: PR Auto Assignment
auto-request-review:
name: Auto request reviews
uses: celestiaorg/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length
secrets: inherit
# write access for issues and pull requests is needed because the called
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: >
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -53,7 +53,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand All @@ -65,7 +65,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ run.sh
testing/e2e/networks/*/
square/testdata
**/*.html
.release-env
**/*.DS_Store
vendor
99 changes: 73 additions & 26 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,93 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# NOTE: CGO is required for ledger support to work, however goreleaser
# technically doesn't support CGO. But it seems to work so that's cool. This
# only seems to work because we are building for a single binary. Cross
# compiling binaries for multiple distributions doesn't work and a proper
# workaround will be needed.
#
# REF: https://goreleaser.com/limitations/cgo/

# Ledger support is only available if the binary is built with CGO enabled.
# Since GoReleaser doesn't support CGO natively, our GoReleaser process builds
# binaries in a Docker image maintained by goreleaser-cross that has CGO support
# for multiple platforms. See https://github.com/goreleaser/goreleaser-cross
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/celestia-appd
- id: darwin-amd64
main: ./cmd/celestia-appd
binary: celestia-appd
env:
- SDKPath={{ "github.com/cosmos/cosmos-sdk/version" }}
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
goarch:
- amd64
goos:
- darwin
tags:
- ledger
ldflags:
# Ref: https://goreleaser.com/customization/templates/#common-fields
# .Version is the version being released
# .FullCommit is git commit hash goreleaser is using for the release
- -X "{{ .Env.SDKPath }}.Name=celestia-app"
- -X "{{ .Env.SDKPath }}.AppName=celestia-appd"
- -X "{{ .Env.SDKPath }}.Version={{ .Version }}"
- -X "{{ .Env.SDKPath }}.Commit={{ .FullCommit }}"
- id: darwin-arm64
main: ./cmd/celestia-appd
binary: celestia-appd
env:
- SDKPath={{ "github.com/cosmos/cosmos-sdk/version" }}
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
goarch:
- arm64
goos:
- darwin
tags:
- ledger
ldflags:
# Ref: https://goreleaser.com/customization/templates/#common-fields
# .Version is the version being released
# .FullCommit is git commit hash goreleaser is using for the release
- -X "{{ .Env.SDKPath }}.Name=celestia-app"
- -X "{{ .Env.SDKPath }}.AppName=celestia-appd"
- -X "{{ .Env.SDKPath }}.Version={{ .Version }}"
- -X "{{ .Env.SDKPath }}.Commit={{ .FullCommit }}"
- id: linux-amd64
main: ./cmd/celestia-appd
binary: celestia-appd
env:
- SDKPath={{ "github.com/cosmos/cosmos-sdk/version" }}
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
goarch:
- amd64
goos:
- linux
tags:
- ledger
ldflags:
# Ref: https://goreleaser.com/customization/templates/#common-fields
#
# .Version is the version being released
# .FullCommit is git commit hash goreleaser is using for the release
#
- -X "{{ .Env.SDKPath }}.Name=celestia-app"
- -X "{{ .Env.SDKPath }}.AppName=celestia-appd"
- -X "{{ .Env.SDKPath }}.Version={{ .Version }}"
- -X "{{ .Env.SDKPath }}.Commit={{ .FullCommit }}"
- id: linux-arm64
main: ./cmd/celestia-appd
binary: celestia-appd
env:
- SDKPath={{ "github.com/cosmos/cosmos-sdk/version" }}
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
goarch:
- arm64
goos:
- linux
tags:
- ledger
ldflags:
# Ref: https://goreleaser.com/customization/templates/#common-fields
# .Version is the version being released
# .FullCommit is git commit hash goreleaser is using for the release
- -X "{{ .Env.SDKPath }}.Name=celestia-app"
- -X "{{ .Env.SDKPath }}.AppName=celestia-appd"
- -X "{{ .Env.SDKPath }}.Version={{ .Version }}"
Expand All @@ -49,18 +106,6 @@ archives:
{{- if .Arm }}v{{ .Arm }}{{ end }}
checksum:
name_template: "checksums.txt"
signs:
- artifacts: checksum
args:
[
"--batch",
"-u",
"{{ .Env.GPG_FINGERPRINT }}",
"--output",
"${signature}",
"--detach-sign",
"${artifact}",
]
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
Expand All @@ -69,3 +114,5 @@ changelog:
exclude:
- "^docs:"
- "^test:"
git:
prerelease_suffix: "-"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# stage 1 Generate celestia-appd Binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.4-alpine3.18 as builder
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.5-alpine3.18 as builder

ARG TARGETOS
ARG TARGETARCH
Expand All @@ -21,7 +21,7 @@ RUN uname -a &&\
make build

# stage 2
FROM docker.io/alpine:3.18.4
FROM docker.io/alpine:3.19.0

# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
Expand Down
36 changes: 19 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ IMAGE := ghcr.io/tendermint/docker-build-proto:latest
DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace $(IMAGE)
PROJECTNAME=$(shell basename "$(PWD)")
HTTPS_GIT := https://github.com/celestiaorg/celestia-app.git
PACKAGE_NAME := github.com/celestiaorg/celestia-app
GOLANG_CROSS_VERSION ?= v1.21.4

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-app \
Expand Down Expand Up @@ -127,7 +129,7 @@ test-race:
# TODO: Remove the -skip flag once the following tests no longer contain data races.
# https://github.com/celestiaorg/celestia-app/issues/1369
@echo "--> Running tests in race mode"
@go test ./... -v -race -skip "TestPrepareProposalConsistency|TestIntegrationTestSuite|TestBlobstreamRPCQueries|TestSquareSizeIntegrationTest|TestStandardSDKIntegrationTestSuite|TestTxsimCommandFlags|TestTxsimCommandEnvVar|TestMintIntegrationTestSuite|TestBlobstreamCLI|TestUpgrade|TestMaliciousTestNode|TestMaxTotalBlobSizeSuite|TestQGBIntegrationSuite|TestSignerTestSuite|TestPriorityTestSuite|TestTimeInPrepareProposalContext|TestBlobstream|TestUnspentGasRefundDecorator"
@go test ./... -v -race -skip "TestPrepareProposalConsistency|TestIntegrationTestSuite|TestBlobstreamRPCQueries|TestSquareSizeIntegrationTest|TestStandardSDKIntegrationTestSuite|TestTxsimCommandFlags|TestTxsimCommandEnvVar|TestMintIntegrationTestSuite|TestBlobstreamCLI|TestUpgrade|TestMaliciousTestNode|TestMaxTotalBlobSizeSuite|TestQGBIntegrationSuite|TestSignerTestSuite|TestPriorityTestSuite|TestTimeInPrepareProposalContext|TestBlobstream|TestUnspentGasRefundDecorator|TestCLITestSuite"
.PHONY: test-race

## test-bench: Run unit tests in bench mode.
Expand Down Expand Up @@ -172,19 +174,19 @@ adr-gen:
@curl -sSL https://raw.githubusercontent.com/celestiaorg/.github/main/adr-template.md > docs/architecture/adr-template.md
.PHONY: adr-gen

## goreleaser: List Goreleaser commands and checks if GoReleaser is installed.
goreleaser: Makefile
@echo " Choose a goreleaser command to run:"
@sed -n 's/^## goreleaser/goreleaser/p' $< | column -t -s ':' | sed -e 's/^/ /'
@goreleaser --version
.PHONY: goreleaser

## goreleaser-build: Builds the celestia-appd binary using GoReleaser for your local OS.
goreleaser-build:
goreleaser build --snapshot --clean --single-target
.PHONY: goreleaser-build

## goreleaser-release: Builds the release celestia-appd binary as defined in .goreleaser.yaml. This requires there be a git tag for the release in the local git history.
goreleaser-release:
goreleaser release --clean --fail-fast --skip-publish
.PHONY: goreleaser-release
## prebuilt-binary: Create prebuilt binaries and attach them to GitHub release. Requires Docker.
prebuilt-binary:
@if [ ! -f ".release-env" ]; then \
echo "A .release-env file was not found but is required to create prebuilt binaries. This command is expected to be run in CI where a .release-env file exists. If you need to run this command locally to attach binaries to a release, you need to create a .release-env file with a Github token (classic) that has repo:public_repo scope."; \
exit 1;\
fi
docker run \
--rm \
-e CGO_ENABLED=1 \
--env-file .release-env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --clean
.PHONY: prebuilt-binary
Loading

0 comments on commit 62fb75c

Please sign in to comment.