ci: add goreleaser for rosetta and add go cache (#14190)

* chore: add goreleaser for rosetta and add go cache

* updates

* don't fetch too much
This commit is contained in:
Julien Robert 2022-12-07 12:51:58 +01:00 committed by GitHub
parent b3ff838858
commit a21ce7dee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 153 additions and 64 deletions

View File

@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:

View File

@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2

View File

@ -17,7 +17,7 @@ jobs:
token: ${{ secrets.PRBOT_PAT }}
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Extract updated dependency
id: deps
run: |

View File

@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: "Dependency Review"

View File

@ -16,8 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
# ci is set to go1.19 to match developer setups
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3

View File

@ -14,11 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
# get 'v*.*.*' part from 'cosmovisor/v*.*.*' and save to $GITHUB_ENV
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/cosmovisor/}" >> $GITHUB_ENV

38
.github/workflows/release-rosetta.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Release Rosetta
on:
push:
tags:
- "tools/rosetta/v*.*.*"
permissions:
contents: read
jobs:
goreleaser:
permissions:
contents: write # for goreleaser/goreleaser-action to create a GitHub release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.4
# get 'v*.*.*' part from 'rosetta/v*.*.*' and save to $GITHUB_ENV
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/rosetta/}" >> $GITHUB_ENV
# remove the possible pre-existing same tag for cosmos-sdk related tags instead of rosetta tags
# Because goreleaser enforces semantic versioning and will error on non compliant tags.(https://goreleaser.com/limitations/semver/)
- name: Tag without prefix locally to avoid error in goreleaser
run: |-
git tag -d ${{ env.RELEASE_VERSION }} || echo "No such a tag exists before"
git tag ${{ env.RELEASE_VERSION }} HEAD
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
# stick to version v0.179.0(https://github.com/cosmos/cosmos-sdk/issues/11125)
version: v0.179.0
args: release --rm-dist --skip-validate --release-notes ./RELEASE_NOTES.md
workdir: tools/rosetta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: rosetta/${{ env.RELEASE_VERSION }}

View File

@ -20,7 +20,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Create release

View File

@ -21,7 +21,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- run: make build
install-runsim:
@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3
@ -49,7 +49,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -67,7 +67,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -86,7 +86,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin

View File

@ -21,7 +21,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- run: make build
install-runsim:
@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3
@ -50,7 +50,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -68,7 +68,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -86,7 +86,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin

View File

@ -21,7 +21,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- run: make build
install-runsim:
@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3
@ -50,7 +50,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -68,7 +68,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -86,7 +86,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin

View File

@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3
@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin

View File

@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- run: make build
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin
@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- uses: actions/cache@v3
with:
path: ~/go/bin

View File

@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
- name: Create a file with all core Cosmos SDK pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
@ -52,7 +52,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -81,7 +83,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -109,7 +113,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -136,8 +142,6 @@ jobs:
needs: [tests, test-integration, test-e2e]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -186,7 +190,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -213,7 +219,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -241,11 +249,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: client/v2/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -271,11 +279,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: core/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -301,11 +309,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: depinject/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -331,7 +339,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: errors/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -357,11 +367,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: math/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -389,7 +399,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: simapp/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -422,7 +434,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: tx/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -449,11 +463,11 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: tools/rosetta/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
@ -484,7 +498,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.3
go-version: 1.19.4
cache: true
cache-dependency-path: tools/cosmovisor/go.sum
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:

View File

@ -7,7 +7,7 @@ require (
cosmossdk.io/core v0.3.2
cosmossdk.io/depinject v1.0.0-alpha.3
cosmossdk.io/math v1.0.0-beta.4
cosmossdk.io/tools/rosetta v0.1.0
cosmossdk.io/tools/rosetta v0.2.0
github.com/cosmos/cosmos-sdk v0.47.0-alpha2
github.com/golang/mock v1.6.0
github.com/spf13/cast v1.5.0
@ -162,9 +162,6 @@ require (
)
replace (
// temporarily until new rosetta
cosmossdk.io/tools/rosetta => ../tools/rosetta
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// Simapp always use the latest version of the cosmos-sdk
github.com/cosmos/cosmos-sdk => ../.

View File

@ -56,6 +56,8 @@ cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w
cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE=
cosmossdk.io/math v1.0.0-beta.4 h1:JtKedVLGzA0vv84xjYmZ75RKG35Kf2WwcFu8IjRkIIw=
cosmossdk.io/math v1.0.0-beta.4/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM=
cosmossdk.io/tools/rosetta v0.2.0 h1:Ae499UiZ9yPNCXvjOBO/R9I1pksCJfxoqWauEZgA/gs=
cosmossdk.io/tools/rosetta v0.2.0/go.mod h1:3mn8QuE2wLUdTi77/gbDXdFqXZdBdiBJhgAWUTSXPv8=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=

View File

@ -2,6 +2,6 @@
* Rename cosmovisor package to `cosmossdk.io/tools/cosmovisor`.
### Changelog
## Changelog
For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/cosmovisor/v1.4.0/cosmovisor/CHANGELOG.md).
For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/tools/cosmovisor/v1.4.0/tools/cosmovisor/CHANGELOG.md).

View File

@ -0,0 +1,34 @@
project_name: rosetta
release:
disable: false
name_template: "{{.Tag}}"
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/rosetta
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=0
archives:
- name_template: '{{ replace .Version "rosetta/" "rosetta-" }}-{{ .Os }}-{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'SHA256SUMS-{{ replace .Version "rosetta/" "rosetta-" }}.txt'
algorithm: sha256
changelog:
skip: false

View File

@ -0,0 +1,5 @@
# Rosetta v0.2.0 Release Notes
## Changelog
For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/tools/rosetta/v0.2.0/tools/rosetta/CHANGELOG.md).