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 11:51:58 +00:00
committed by GitHub
parent b3ff838858
commit a21ce7dee3
19 changed files with 153 additions and 64 deletions
+1 -1
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:
+1 -1
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
+1 -1
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: |
+1 -1
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"
+1 -2
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
@@ -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
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 }}
+1 -1
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
+5 -5
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
+5 -5
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
+5 -5
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
+2 -2
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
+4 -4
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
+43 -27
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: