-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
363 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# triggered when a semantic version tag is pushed (vX.X.X) | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
- "v[0-9]+\\.[0-9]+\\.[0-9]+-alpha[0-9]+" # vX.X.X-alphaX | ||
- "v[0-9]+\\.[0-9]+\\.[0-9]+-beta[0-9]+" # vX.X.X-betaX | ||
- "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" # vX.X.X-rcX | ||
- "v[0-9]+\\.[0-9]+\\.[0-9]+" # vX.X.X | ||
concurrency: | ||
group: ci-${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
cache: true | ||
|
||
- name: Set ENV | ||
run: echo "COMET_VERSION=$(go list -m github.com/cometbft/cometbft | sed 's:.* ::')" >> $GITHUB_ENV | ||
|
||
- name: goreleaser test-build | ||
uses: goreleaser/goreleaser-action@v5 | ||
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Enable:ReleaseBuild') | ||
with: | ||
version: latest | ||
args: build --clean --skip=validate | ||
env: | ||
COMET_VERSION: ${{ env.COMET_VERSION }} | ||
- name: Release | ||
uses: goreleaser/goreleaser-action@v5 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMET_VERSION: ${{ env.COMET_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Tests / Code Coverage | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled] | ||
merge_group: | ||
types: [checks_requested] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }}-tests | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [amd64, arm64] | ||
targetos: [darwin, linux] | ||
name: sedad ${{ matrix.targetos }}-${{ matrix.arch }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache binaries | ||
id: cache-binaries | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./cmd/sedad/sedad | ||
key: sedad-${{ matrix.targetos }}-${{ matrix.arch }} | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Setup go | ||
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.19" | ||
cache: true | ||
env: | ||
GOOS: ${{ matrix.targetos }} | ||
GOARCH: ${{ matrix.arch }} | ||
- name: Compile | ||
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF | ||
run: | | ||
go mod download | ||
make build | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
check-latest: true | ||
cache: true | ||
cache-dependency-path: go.sum | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/*.go | ||
go.mod | ||
go.sum | ||
**/go.mod | ||
**/go.sum | ||
**/Makefile | ||
Makefile | ||
- name: test & coverage report creation | ||
if: env.GIT_DIFF | ||
run: make test-unit-cover | ||
- uses: actions/upload-artifact@v3 | ||
if: env.GIT_DIFF | ||
with: | ||
name: "${{ github.sha }}-${{ matrix.part }}-coverage" | ||
path: ./${{ matrix.part }}profile.out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,7 @@ build/ | |
.idea/ | ||
.vscode/ | ||
.DS_Store | ||
dist/ | ||
/.act-event-file | ||
scripts/testnet/config.sh | ||
scripts/testnet/nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
project_name: seda | ||
|
||
env: | ||
- CGO_ENABLED=1 | ||
# - GOOS=linux # for local m1 mac run | ||
|
||
before: | ||
hooks: | ||
- go mod download | ||
|
||
builds: | ||
- main: ./cmd/seda-chaind | ||
id: "sedad" | ||
binary: sedad | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
flags: | ||
- -tags=badgerdb ledger netgo | ||
- -trimpath | ||
ldflags: | ||
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=seda-chain -X github.com/cosmos/cosmos-sdk/version.AppName=sedad-chain -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger -X github.com/cometbft/cometbft/version.TMCoreSemVer={{ .Env.COMET_VERSION }} | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
# - arm64 # github only supports linux @ amd64 :'( | ||
|
||
archives: | ||
- id: tarball | ||
format: tar.gz | ||
wrap_in_directory: false # must not wrap into directory to support cosmwasm | ||
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
snapshot: | ||
name_template: SNAPSHOT-{{ .Commit }} | ||
|
||
checksum: | ||
name_template: SHA256SUMS-v{{.Version}}.txt | ||
algorithm: sha256 | ||
|
||
changelog: | ||
skip: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM golang:1.21-alpine AS build-env | ||
|
||
# Install minimum necessary dependencies | ||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev | ||
RUN apk add --no-cache $PACKAGES | ||
|
||
|
||
WORKDIR /go/src/github.com/sedaprotocol/seda-chain | ||
|
||
# Optimized fetching of dependencies | ||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
# Copy and build the project | ||
COPY . . | ||
|
||
# Dockerfile Cross-Compilation Guide | ||
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide | ||
ARG TARGETOS TARGETARCH | ||
|
||
|
||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build | ||
|
||
|
||
FROM alpine:3 | ||
|
||
RUN apk add --no-cache curl make bash jq sed | ||
COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/build/seda-chaid /usr/bin/seda-chaind | ||
|
||
EXPOSE 26656 26657 1317 9090 | ||
|
||
CMD ["seda-chaind", "start"] | ||
STOPSIGNAL SIGTERM | ||
WORKDIR /root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.