Skip to content

Commit a642968

Browse files
authored
build: update release pipeline to match non-wasm env (#901)
* remove useless cmd & config related to wasm * add multi-arch config to generate bins * add CHANGELOG * change default releaser image * remove wasm-binding in Dockerfile * remove wasm config in simapp
1 parent 302cb11 commit a642968

File tree

7 files changed

+66
-48
lines changed

7 files changed

+66
-48
lines changed

.github/workflows/tag.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
make release
1919
env:
2020
GORELEASER_MOUNT_CONFIG: true
21-
GORELEASER_IMAGE: line/goreleaserx-wasm:1.0.0-0.10.0
21+
GORELEASER_IMAGE: line/goreleaserx:1.13.1-1.19.3
2222
GORELEASER_RELEASE: true
23-
BUILD_TAGS: static
2423
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

+59
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,62 @@ builds:
1111
- amd64
1212
env:
1313
- CGO_ENABLED=1
14+
- CC=x86_64-linux-gnu-gcc
15+
- CXX=x86_64-linux-gnu-g++
16+
flags:
17+
- -mod=readonly
18+
- -trimpath
19+
- "-tags={{ .Env.BUILD_TAGS }}"
20+
ldflags:
21+
- "{{ .Env.BUILD_VARS }}"
22+
23+
- id: simd-linux-arm64
24+
main: ./simapp/simd
25+
binary: simd
26+
goos:
27+
- linux
28+
goarch:
29+
- arm64
30+
env:
31+
- CGO_ENABLED=1
32+
- CC=aarch64-linux-gnu-gcc
33+
- CXX=aarch64-linux-gnu-g++
34+
flags:
35+
- -mod=readonly
36+
- -trimpath
37+
- "-tags={{ .Env.BUILD_TAGS }}"
38+
ldflags:
39+
- "{{ .Env.BUILD_VARS }}"
40+
41+
- id: simd-darwin-amd64
42+
main: ./simapp/simd
43+
binary: simd
44+
goos:
45+
- darwin
46+
goarch:
47+
- amd64
48+
env:
49+
- CGO_ENABLED=1
50+
- CC=o64-clang
51+
- CXX=o64-clang++
52+
flags:
53+
- -mod=readonly
54+
- -trimpath
55+
- "-tags={{ .Env.BUILD_TAGS }}"
56+
ldflags:
57+
- "{{ .Env.BUILD_VARS }}"
58+
59+
- id: simd-darwin-arm64
60+
main: ./simapp/simd
61+
binary: simd
62+
goos:
63+
- darwin
64+
goarch:
65+
- arm64
66+
env:
67+
- CGO_ENABLED=1
68+
- CC=oa64-clang
69+
- CXX=oa64-clang++
1470
flags:
1571
- -mod=readonly
1672
- -trimpath
@@ -23,6 +79,9 @@ archives:
2379
id: bin-archive
2480
builds:
2581
- simd-linux-amd64
82+
- simd-linux-arm64
83+
- simd-darwin-amd64
84+
- simd-darwin-arm64
2685
format: tar.gz
2786
name_template: "simd_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
2887
wrap_in_directory: true

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
7676
### Build, CI
7777
* (ci) [\#829](https://github.com/line/lbm-sdk/pull/829) automate release process
7878
* (build) [\#872](https://github.com/line/lbm-sdk/pull/872) Retract v1.0.0
79+
* (ci, build) [\#901](https://github.com/line/lbm-sdk/pull/901) Update release pipeline to match non-wasm env
7980

8081
### Document Updates

Dockerfile

+1-10
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,11 @@ COPY ./go.mod /go/src/github.com/line/lbm-sdk/go.mod
3030
COPY ./go.sum /go/src/github.com/line/lbm-sdk/go.sum
3131
RUN go mod download
3232

33-
# See https://github.com/line/wasmvm/releases
34-
# See https://github.com/line/wasmvm/releases
35-
ADD https://github.com/line/wasmvm/releases/download/v1.0.0-0.10.0/libwasmvm_static.x86_64.a /lib/libwasmvm_static.x86_64.a
36-
ADD https://github.com/line/wasmvm/releases/download/v1.0.0-0.10.0/libwasmvm_static.aarch64.a /lib/libwasmvm_static.aarch64.a
37-
RUN sha256sum /lib/libwasmvm_static.aarch64.a | grep bc3db72ba32f34ad88ceb1d20479411bd7f50ccd6a5ca50cc8ca462a561e6189
38-
RUN sha256sum /lib/libwasmvm_static.x86_64.a | grep 352fa5de5f9dba66f0a38082541d3e63e21394fee3e577ea35e0906294c61276
39-
40-
RUN ln -s /lib/libwasmvm_static.${ARCH}.a /usr/lib/libwasmvm_static.a
41-
4233
# Add source files
4334
COPY . .
4435

4536
# install simapp, remove packages
46-
RUN BUILD_TAGS=static make build CGO_ENABLED=1
37+
RUN make build CGO_ENABLED=1
4738

4839
# Final image
4940
FROM alpine:edge

Makefile

+3-7
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,12 @@ libsodium:
576576
GORELEASER_CONFIG ?= .goreleaser.yml
577577

578578
GORELEASER_BUILD_LDF = $(ldflags)
579-
GORELEASER_BUILD_LDF += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
580579
GORELEASER_BUILD_LDF := $(strip $(GORELEASER_BUILD_LDF))
581580

582581
GORELEASER_SKIP_VALIDATE ?= false
583582
GORELEASER_DEBUG ?= false
584-
GORELEASER_IMAGE ?= line/goreleaserx-wasm:1.0.0-0.10.0
583+
GORELEASER_IMAGE ?= line/goreleaserx:1.13.1-1.19.3
585584
GORELEASER_RELEASE ?= false
586-
#GO_MOD_NAME := $(shell go list -m 2>/dev/null)
587585
GO_MOD_NAME := github.com/line/lbm-sdk
588586

589587
ifeq ($(GORELEASER_RELEASE),true)
@@ -613,6 +611,7 @@ release-snapshot:
613611
--skip-validate=$(GORELEASER_SKIP_VALIDATE) \
614612
--debug=$(GORELEASER_DEBUG) \
615613
--rm-dist
614+
616615
release:
617616
docker run --rm \
618617
-e BUILD_TAGS="$(build_tags)" \
@@ -629,7 +628,4 @@ release:
629628
--debug=$(GORELEASER_DEBUG) \
630629
--rm-dist
631630

632-
build-static: go.sum
633-
CGO_ENABLED=1 go build -mod=readonly -tags "$(build_tags)" -ldflags '$(GORELEASER_BUILD_LDF)' -trimpath -o ./build/ ./...
634-
635-
.PHONY: release-snapshot release build-static
631+
.PHONY: release-snapshot release

simapp/simd/cmd/root.go

+1-23
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"errors"
5-
65
"io"
76
"os"
87
"path/filepath"
@@ -90,19 +89,8 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
9089
func initAppConfig() (string, interface{}) {
9190
// The following code snippet is just for reference.
9291

93-
// WASMConfig defines configuration for the wasm module.
94-
type WASMConfig struct {
95-
// This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
96-
QueryGasLimit uint64 `mapstructure:"query_gas_limit"`
97-
98-
// Address defines the gRPC-web server to listen on
99-
LruSize uint64 `mapstructure:"lru_size"`
100-
}
101-
10292
type CustomAppConfig struct {
10393
serverconfig.Config
104-
105-
WASM WASMConfig `mapstructure:"wasm"`
10694
}
10795

10896
// Optionally allow the chain developer to overwrite the SDK's default
@@ -125,19 +113,9 @@ func initAppConfig() (string, interface{}) {
125113

126114
customAppConfig := CustomAppConfig{
127115
Config: *srvCfg,
128-
WASM: WASMConfig{
129-
LruSize: 1,
130-
QueryGasLimit: 300000,
131-
},
132116
}
133117

134-
customAppTemplate := serverconfig.DefaultConfigTemplate + `
135-
[wasm]
136-
# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
137-
query_gas_limit = 300000
138-
# This is the number of wasm vm instances we keep cached in memory for speed-up
139-
# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally
140-
lru_size = 0`
118+
customAppTemplate := serverconfig.DefaultConfigTemplate
141119

142120
return customAppTemplate, customAppConfig
143121
}

simapp/test_helpers.go

-6
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,6 @@ func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...ba
209209
return app
210210
}
211211

212-
// SetupWithEmptyStore setup a wasmd app instance with empty DB
213-
func SetupWithEmptyStore() *SimApp {
214-
app, _ := setup(false, 0)
215-
return app
216-
}
217-
218212
type GenerateAccountStrategy func(int) []sdk.AccAddress
219213

220214
// createRandomAccounts is a strategy used by addTestAddrs() in order to generated addresses in random order.

0 commit comments

Comments
 (0)