Skip to content

Commit 313df4c

Browse files
committed
use goreleaser for build/release
1 parent e836350 commit 313df4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+97452
-739
lines changed

.github/workflows/aws-ecr.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Darwin Binaries
2+
3+
# reusable workflow, do not add triggers
4+
on:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-binaries:
10+
name: Build xiond-${{ matrix.os }}-${{ matrix.arch }}
11+
runs-on: 'ubuntu-latest'
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- darwin
18+
arch:
19+
- amd64
20+
- arm64
21+
22+
steps:
23+
- name: Check Out Code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set Go Version
29+
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
30+
31+
- name: Set up Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: ${{ env.GO_VERSION }}
35+
36+
- name: Build darwin Binary
37+
env:
38+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
39+
run: |
40+
make build-${{ matrix.os }}-${{ matrix.arch }}
41+
42+
- name: Upload Binary
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: xiond-${{ matrix.os }}-${{ matrix.arch }}
46+
path: dist/**/xiond-${{ matrix.os }}-${{ matrix.arch }}
47+
retention-days: 3
48+
if-no-files-found: error
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Linux Binaries
2+
3+
# reusable workflow, do not add triggers
4+
on:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-binaries:
10+
name: Build xiond-${{ matrix.os }}-${{ matrix.arch }}
11+
runs-on: ${{ matrix.arch == 'arm64' && format('github-{0}', matrix.arch) || 'ubuntu-latest' }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- linux
18+
arch:
19+
- amd64
20+
- arm64
21+
22+
steps:
23+
- name: Check Out Code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set Go Version
29+
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
30+
31+
- name: Set up Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: ${{ env.GO_VERSION }}
35+
36+
- name: Build Linux Binary
37+
env:
38+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
39+
run: |
40+
make build-${{ matrix.os }}-${{ matrix.arch }}
41+
42+
- name: Upload Binary
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: xiond-${{ matrix.os }}-${{ matrix.arch }}
46+
path: dist/**/xiond-${{ matrix.os }}-${{ matrix.arch }}
47+
retention-days: 3
48+
if-no-files-found: error
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Test Binaries
2+
3+
# reusable workflow, do not add triggers
4+
on:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-integration:
10+
name: Build test-${{ matrix.os }}-${{ matrix.arch }}
11+
runs-on: ${{ matrix.arch == 'arm64' && format('github-{0}', matrix.arch) || 'ubuntu-latest' }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- linux
18+
arch:
19+
- amd64
20+
- arm64
21+
22+
steps:
23+
- name: Check Out Code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set Go Version
29+
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' integration_tests/go.mod >> $GITHUB_ENV
30+
31+
- name: Set up Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: ${{ env.GO_VERSION }}
35+
36+
- name: Build Test Binary
37+
working-directory: integration_tests
38+
run: |
39+
go test -c -o ../dist/test-${{ matrix.os }}-${{ matrix.arch }}
40+
41+
- name: Upload Test Binaries
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: test-${{ matrix.os }}-${{ matrix.arch }}
45+
path: dist/test-${{ matrix.os }}-${{ matrix.arch }}
46+
retention-days: 3
47+
if-no-files-found: error
48+
49+
- name: find wasmvm lib
50+
run: |
51+
WASM_PATH="$(find /home/runner/go/pkg/mod -name libwasmvm.$(uname -m).so 2>/dev/null | head -n 1)"
52+
echo "WASM_PATH=$WASM_PATH" | tee -a $GITHUB_ENV
53+
echo "WASM_FILE=$(basename $WASM_PATH)" | tee -a $GITHUB_ENV
54+
55+
- name: Upload wasmvm lib
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: ${{ env.WASM_FILE }}
59+
path: ${{ env.WASM_PATH }}
60+
if-no-files-found: error
61+
retention-days: 3
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Release Info
2+
# Run for new release tags only
3+
4+
on:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-release-info:
10+
runs-on: ubuntu-latest
11+
env:
12+
GH_TOKEN: ${{ github.token }}
13+
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Prepare environment
19+
run: mkdir -p release
20+
21+
- name: Download artifacts
22+
uses: actions/download-artifact@v4
23+
with:
24+
path: release
25+
pattern: xiond-*
26+
merge-multiple: true
27+
28+
- name: Create version.json
29+
working-directory: release
30+
run: |
31+
set -Eeuo pipefail
32+
upgrade_name=$(echo $GITHUB_REF_NAME | cut -d. -f1)
33+
jq -s '.[0] * (.[1] // {})' <(go mod edit -json | jq --arg name $upgrade_name '{
34+
name: $name,
35+
tag: "${{ github.ref_name }}",
36+
height: 0,
37+
proposal: 0,
38+
go_version: .Go,
39+
cosmos_sdk_version: (.Require[] | select(.Path == "github.com/cosmos/cosmos-sdk") | .Version),
40+
cosmwasm_enabled: (.Require[] | select(.Path == "github.com/CosmWasm/wasmd") != null),
41+
cosmwasm_version: (.Require[] | select(.Path == "github.com/CosmWasm/wasmd") | .Version),
42+
ibc_go_version: (.Require[] | select(.Path == "github.com/cosmos/ibc-go/v7") | .Version),
43+
consensus: {
44+
type: "cometbft",
45+
version: (.Require[] | select(.Path == "github.com/cometbft/cometbft") | .Version)
46+
}
47+
}') binaries.json | tee version.json
48+
49+
- name: Upload version.json files
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: version.json
53+
path: release/version.json
54+
retention-days: 3
55+
if-no-files-found: error
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build Release
2+
# Run for new release tags only
3+
# superceded by goreleaser.yaml
4+
5+
on:
6+
workflow_call:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-release:
11+
runs-on: ubuntu-latest
12+
env:
13+
GH_TOKEN: ${{ github.token }}
14+
15+
steps:
16+
- name: Create release directory
17+
run: mkdir -p release
18+
19+
- name: Build Changelog
20+
id: changelog
21+
uses: mikepenz/release-changelog-builder-action@v4
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Output Changelog
26+
run: echo "${{steps.changelog.outputs.changelog}}"
27+
28+
- name: Create release for ${{ github.ref_name }}
29+
id: update-release
30+
uses: ncipollo/release-action@v1
31+
with:
32+
name: Release ${{ github.ref_name }}
33+
allowUpdates: true
34+
body: ${{ steps.changelog.outputs.changelog }}
35+
draft: false
36+
generateReleaseNotes: true
37+
prerelease: true
38+
removeArtifacts: false # important, true will remove src archives
39+
tag: ${{ github.ref_name }}
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
updateOnlyUnreleased: true
42+
43+
- name: Download release archives
44+
working-directory: release
45+
run: |
46+
gh release download ${{ github.ref_name }} \
47+
--repo=${{ github.repository }} \
48+
--archive=tar.gz
49+
gh release download ${{ github.ref_name }} \
50+
--repo=${{ github.repository }} \
51+
--archive=zip
52+
ls
53+
54+
- name: Download artifacts
55+
uses: actions/download-artifact@v4
56+
with:
57+
path: release
58+
pattern: xiond-*
59+
merge-multiple: true
60+
61+
- name: Create checksums
62+
working-directory: release
63+
run: |
64+
sha256sum * | tee checksum.txt
65+
66+
- name: Remove release archives
67+
working-directory: release
68+
run: |
69+
rm -f *.zip *.tar.gz
70+
ls
71+
72+
- name: Upload release assets
73+
working-directory: release
74+
run: |
75+
gh release upload ${{ github.ref_name }} * \
76+
--repo ${{ github.repository }} \
77+
--clobber

0 commit comments

Comments
 (0)