Skip to content

Commit

Permalink
build: update golang version to 1.20 (#1043)
Browse files Browse the repository at this point in the history
* Update golang version to 1.20 and replace ostracon

* Update golang versions in workflows & Dockerfiles

* Fix version to string in workflows

* Update snapshot test

* Update CHANGELOG.md

* Update lint action

* Lint

* Update lint target

* Update docs

* Revert replace
  • Loading branch information
0Tech authored Jul 25, 2023
1 parent 3e775ff commit 43555be
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 82 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@master
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49.0
version: v1.51
args: --timeout 10m
github-token: ${{ secrets.GITHUB_TOKEN }}
if: env.GIT_DIFF
2 changes: 1 addition & 1 deletion .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: ./.github/actions/generate-swagger
- name: diff
run: git diff
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- run: |
make build
Expand All @@ -39,7 +39,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: install runsim
run: |
export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
Expand All @@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: actions/[email protected]
with:
path: ~/go/bin
Expand All @@ -75,7 +75,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: actions/[email protected]
with:
path: ~/go/bin
Expand All @@ -95,7 +95,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: actions/[email protected]
with:
path: ~/go/bin
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- run: make build
Expand All @@ -37,7 +37,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- name: Install runsim
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand All @@ -81,7 +81,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sims_normal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- run: make build
Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- name: Install runsim
Expand All @@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: actions/[email protected]
Expand All @@ -59,7 +59,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: actions/[email protected]
Expand All @@ -77,7 +77,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: actions/[email protected]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- name: install tparse
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: technote-space/[email protected]
id: git_diff
with:
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- name: Display go version
run: go version
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.18
go-version: '1.20'
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
# - uses: actions/checkout@v3
# - uses: actions/[email protected]
# with:
# go-version: 1.18
# go-version: '1.20'
# - uses: technote-space/[email protected]
# id: git_diff
# with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/foundation) [\#999](https://github.com/Finschia/finschia-sdk/pull/999) migrate x/foundation FoundationTax into x/params

### Build, CI
* (build,ci) [\#1043](https://github.com/Finschia/finschia-sdk/pull/1043) Update golang version to 1.20

### Document Updates
* (readme) [\#997](https://github.com/finschia/finschia-sdk/pull/997) fix swagger url
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Please don't make Pull Requests from `main`.

## Dependencies

We use [Go 1.18 Modules](https://github.com/golang/go/wiki/Modules) to manage
We use [Go 1.20 Modules](https://github.com/golang/go/wiki/Modules) to manage
dependency versions.

The `main` branch of every LBM repository should just build with `go get`,
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.simappcli:/root/.simapp simapp simd keys add foo
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.simappcli:/root/.simapp simapp simd keys list
# TODO: demo connecting rest-server (or is this in server now?)
FROM golang:alpine AS build-env
FROM golang:1.20-alpine AS build-env
ARG ARCH=$ARCH

# Install minimum necessary dependencies,
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,13 @@ lint: golangci-lint
find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -d -s

golangci-lint:
@go get github.com/golangci/golangci-lint/cmd/golangci-lint
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2

lint-fix:
lint-fix: golangci-lint
golangci-lint run --fix --out-format=tab --issues-exit-code=0
.PHONY: lint lint-fix
.PHONY: lint lint-fix golangci-lint

format:
format: golangci-lint
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs gofumpt -w -l
golangci-lint run --fix
.PHONY: format
Expand Down Expand Up @@ -629,4 +629,4 @@ release:
--debug=$(GORELEASER_DEBUG) \
--rm-dist

.PHONY: release-snapshot release
.PHONY: release-snapshot release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is forked from [`cosmos-sdk`](https://github.com/cosmos/cosmos-sdk) at 2021

**WARNING**: Breaking changes may occur because this repository is still in the pre-release development phase.

**Note**: Requires [Go 1.18+](https://golang.org/dl/)
**Note**: Requires [Go 1.20+](https://golang.org/dl/)

## What is the Finschia SDK?

Expand Down
2 changes: 1 addition & 1 deletion contrib/images/simd-dlv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine AS build
FROM golang:1.20-alpine AS build
RUN apk add build-base git linux-headers libc-dev
RUN go install github.com/go-delve/delve/cmd/dlv@latest
WORKDIR /work
Expand Down
2 changes: 1 addition & 1 deletion contrib/images/simd-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine AS build
FROM golang:1.20-alpine AS build
RUN apk add build-base git linux-headers
WORKDIR /work
COPY go.mod go.sum /work/
Expand Down
2 changes: 1 addition & 1 deletion contrib/rosetta/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine as build
FROM golang:1.20-alpine as build

RUN apk add --no-cache tar

Expand Down
2 changes: 1 addition & 1 deletion contrib/rosetta/rosetta-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine as build
FROM golang:1.20-alpine as build

RUN apk add git gcc libc-dev --no-cache

Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ func newRealPrompt(dir string, buf io.Reader) func(string) (string, error) {
continue
}

if err := os.WriteFile(dir+"/keyhash", passwordHash, 0o555); err != nil {
if err := os.WriteFile(dir+"/keyhash", passwordHash, 0o600); err != nil {
return "", err
}

Expand Down
Loading

0 comments on commit 43555be

Please sign in to comment.