Skip to content

Commit

Permalink
ci: use alpine in dockerfile and bump go version (backport cosmos#15703
Browse files Browse the repository at this point in the history
…) (cosmos#15718)

Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Apr 6, 2023
1 parent 91ca844 commit 0867a91
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: technote-space/[email protected]
id: git_diff
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-update-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
token: ${{ secrets.PRBOT_PAT }}
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Extract updated dependency
id: deps
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: "Dependency Review"
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build & Push
# Build & Push builds the simapp docker image on every push to main and
# and pushes the image to https://github.com/cosmos/cosmos-sdk/pkgs/container/simapp
# and pushes the image to https://ghcr.io/cosmos/simapp
on:
pull_request:
paths:
Expand All @@ -11,6 +11,12 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
workflow_dispatch:
inputs:
tags:
description: "SDK version (e.g 0.47.1)"
required: true
type: string

permissions:
contents: read
Expand All @@ -37,8 +43,8 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern=latest-{{major}}.{{minor}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern={{version}},value=v${{ inputs.tags }},enable=${{ inputs.tags != '' }}
flavor: |
latest=false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-cosmovisor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
# get 'v*.*.*' part from 'cosmovisor/v*.*.*' and save to $GITHUB_ENV
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/cosmovisor/}" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-rosetta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
# get 'v*.*.*' part from 'rosetta/v*.*.*' and save to $GITHUB_ENV
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/rosetta/}" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Unshallow
run: git fetch --prune --unshallow
- name: Create release
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sims-045.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- run: make build

install-runsim:
Expand All @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -49,7 +49,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -67,7 +67,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -86,7 +86,7 @@ jobs:
ref: "release/v0.45.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sims-046.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- run: make build

install-runsim:
Expand All @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -50,7 +50,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -68,7 +68,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -86,7 +86,7 @@ jobs:
ref: "release/v0.46.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sims-047.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- run: make build

install-runsim:
Expand All @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -50,7 +50,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -68,7 +68,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -86,7 +86,7 @@ jobs:
ref: "release/v0.47.x"
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sims-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/cache@v3
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- run: make build
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/[email protected]
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand All @@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- uses: actions/cache@v3
with:
path: ~/go/bin
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
- name: Create a file with all core Cosmos SDK pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
Expand All @@ -244,7 +244,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.19.8
cache: true
cache-dependency-path: simapp/go.sum
- uses: technote-space/[email protected]
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ ARG TARGETOS TARGETARCH
# install simapp, remove packages
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build


# Final image, without build artifacts. `/base` already contains openssl, glibc and all required libs to start an app
FROM gcr.io/distroless/base
# Use alpine:3 as a base image
FROM alpine:3

EXPOSE 26656 26657 1317 9090
# Run simd by default, omit entrypoint to ease using container with simcli
Expand Down

0 comments on commit 0867a91

Please sign in to comment.