-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and release linux artifacts on tags (#39)
* Create Github release on tags * Build e2e test runner with CGO
- Loading branch information
Showing
6 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release mesh-security | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write # for goreleaser/goreleaser-action to create a GitHub release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
check-latest: true | ||
- name: Build demo app artifact | ||
run: make build-linux-static | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
id: create_release | ||
with: | ||
draft: false | ||
prerelease: false | ||
body_path: RELEASE_NOTES.md | ||
files: | | ||
demo/build/* | ||
tests/e2e/build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM golang:1.20-alpine AS go-builder | ||
ARG ARCH=x86_64 | ||
|
||
RUN apk add --no-cache ca-certificates build-base git | ||
|
||
WORKDIR /code | ||
|
||
# Download dependencies and CosmWasm libwasmvm if found. | ||
ADD go.mod go.sum ./ | ||
|
||
#ADD https://github.com/CosmWasm/wasmvm/releases/download/v$wasmvm/libwasmvm_muslc.$arch.a /lib/libwasmvm_muslc.$arch.a | ||
## Download | ||
RUN set -eux; \ | ||
WASM_VERSION=v$(go list -m github.com/CosmWasm/wasmvm | cut -d" " -f2 | cut -d"v" -f2); \ | ||
echo $WASM_VERSION; \ | ||
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/${WASM_VERSION}/libwasmvm_muslc.${ARCH}.a | ||
|
||
# Copy over code | ||
COPY . /code | ||
|
||
# force it to use static lib (from above) not standard libgo_cosmwasm.so file | ||
# then log output of file /code/bin/meshd | ||
# then ensure static linking | ||
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build-vendored \ | ||
&& file /code/build/meshd \ | ||
&& echo "Ensuring binary is statically linked ..." \ | ||
&& (file /code/build/meshd | grep "statically linked") | ||
|
||
# -------------------------------------------------------- | ||
FROM alpine:3.16 | ||
|
||
COPY --from=go-builder /code/build/meshd /usr/bin/meshd | ||
|
||
WORKDIR /opt | ||
|
||
# rest server, tendermint p2p, tendermint rpc | ||
EXPOSE 1317 26656 26657 | ||
|
||
CMD ["/usr/bin/meshd", "version"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/usr/bin/make -f | ||
|
||
BUILD_DIR = ./build | ||
|
||
all: test | ||
|
||
test: | ||
go test -mod=readonly -race ./... | ||
|
||
.PHONY: all test | ||
build: | ||
CGO_ENABLED=1 go test -c -mod=readonly -o $(BUILD_DIR)/mesh-security.e2e.test | ||
|
||
build-linux: | ||
CGO_ENABLED=1 GOOS=linux go test -c -mod=readonly -o $(BUILD_DIR)/mesh-security.e2e.test | ||
|
||
.PHONY: all build build-linux test |