Skip to content

Commit c35008c

Browse files
committed
Add go releaser (#263)
1 parent 3cebc42 commit c35008c

10 files changed

Lines changed: 612 additions & 234 deletions

File tree

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
.github/
33
.vscode/
44
build/
5-
devent/
5+
devnet/

.github/workflows/docker-build.yml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,16 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
runner:
19-
- selector: ubuntu-latest
20-
platform: linux/amd64
21-
- selector: burnt-labs-arm64
22-
platform: linux/arm64
23-
runs-on: ${{ matrix.runner.selector }}
18+
os:
19+
- linux
20+
arch:
21+
- amd64
22+
- arm64
23+
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || format('burnt-labs-{0}', matrix.arch) }}
2424

2525
steps:
2626
- name: Check out code
2727
uses: actions/checkout@v4
28-
with:
29-
ref: ${{ github.ref }}
30-
fetch-depth: 0
3128

3229
- name: Set up QEMU
3330
uses: docker/setup-qemu-action@v3
@@ -36,47 +33,46 @@ jobs:
3633
uses: docker/setup-buildx-action@v3
3734
with:
3835
driver: docker
39-
platforms: ${{ matrix.runner.platform }}
36+
platforms: ${{ matrix.os }}/${{ matrix.arch }}
4037

4138
- name: Prepare environment
4239
run: |
43-
echo "PLATFORM=${{ matrix.runner.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
44-
echo "XIOND_FN=xiond/${{ matrix.runner.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
45-
echo "DOCKER_FN=docker/${{ matrix.runner.platform }}.tar" | tr '/' '-' | tee -a $GITHUB_ENV
46-
echo "HEIGHLINER_FN=heighliner/${{ matrix.runner.platform }}.tar" | tr '/' '-' | tee -a $GITHUB_ENV
40+
echo "XIOND_FN=xiond-${{ matrix.os }}-${{ matrix.arch }}" | tee -a $GITHUB_ENV
41+
echo "DOCKER_FN=docker-${{ matrix.os }}-${{ matrix.arch }}.tar" | tee -a $GITHUB_ENV
42+
echo "HEIGHLINER_FN=heighliner-${{ matrix.os }}-${{ matrix.arch }}.tar" | tee -a $GITHUB_ENV
4743
echo "VERSION=$(git describe --tags | sed 's/^v//')" | tee -a $GITHUB_ENV
4844
4945
- name: Build Docker Image
5046
id: build-docker
5147
uses: docker/build-push-action@v5
5248
with:
53-
build-args: |
54-
COMMIT="${GITHUB_SHA}"
55-
VERSION=${{ env.VERSION }}
56-
TAG_VERSION="${GITHUB_SHA:0:7}"
57-
labels: ${{ steps.meta.outputs.labels }}
58-
platforms: ${{ matrix.runner.platform }}
59-
push: false
6049
target: release
61-
outputs: type=docker,name=xion:${{ env.PLATFORM }},name-canonical=true
50+
push: false
51+
load: true
52+
labels: ${{ steps.meta.outputs.labels }}
53+
platforms: ${{ matrix.os }}/${{ matrix.arch }}
54+
tags: xion:${{ matrix.os }}-${{ matrix.arch }}
55+
build-args: |
56+
GORELEASER_CURRENT_TAG=${{ github.ref_name }}
57+
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
6258
6359
- name: Build Heighliner Image
6460
id: build-heighliner
6561
uses: docker/build-push-action@v5
6662
with:
67-
build-args: |
68-
BASE_IMAGE=xion
69-
VERSION=${{ env.PLATFORM }}
70-
BINARIES=/usr/bin/xiond
71-
labels: ${{ steps.meta.outputs.labels }}
72-
platforms: ${{ matrix.runner.platform }}
7363
target: heighliner
74-
outputs: type=docker,name=heighliner:${{ env.PLATFORM }},name-canonical=true
64+
push: false
65+
load: true
66+
labels: ${{ steps.meta.outputs.labels }}
67+
platforms: ${{ matrix.os }}/${{ matrix.arch }}
68+
tags: heighliner:${{ matrix.os }}-${{ matrix.arch }}
69+
build-args: |
70+
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
7571
7672
- name: Save Docker Image
7773
working-directory: ${{ runner.temp }}
7874
run: |
79-
docker save xion:${{ env.PLATFORM }} > ${{ env.DOCKER_FN }}
75+
docker save xion:${{ matrix.os }}-${{ matrix.arch }} > ${{ env.DOCKER_FN }}
8076
8177
- name: Upload Docker Image
8278
uses: actions/upload-artifact@v4
@@ -89,7 +85,7 @@ jobs:
8985
- name: Save Heighliner Image
9086
working-directory: ${{ runner.temp }}
9187
run: |
92-
docker save heighliner:${{ env.PLATFORM }} > ${{ env.HEIGHLINER_FN }}
88+
docker save heighliner:${{ matrix.os }}-${{ matrix.arch }} > ${{ env.HEIGHLINER_FN }}
9389
9490
- name: Upload Heighliner Image
9591
uses: actions/upload-artifact@v4
@@ -104,7 +100,7 @@ jobs:
104100
working-directory: ${{ runner.temp }}
105101
run: |
106102
tmpname="ctr-$(basename $XIOND_FN)"
107-
docker create --platform ${{ matrix.runner.platform }} --name "${tmpname}" "xion:${PLATFORM}"
103+
docker create --platform ${{ matrix.os }}/${{ matrix.arch }} --name "${tmpname}" "xion:${{ matrix.os }}-${{ matrix.arch }}"
108104
docker cp "${tmpname}:/usr/bin/xiond" "${XIOND_FN}"
109105
docker rm -v "${tmpname}"
110106
@@ -114,4 +110,5 @@ jobs:
114110
with:
115111
name: ${{ env.XIOND_FN }}
116112
path: ${{ runner.temp }}/${{ env.XIOND_FN }}
113+
if-no-files-found: error
117114
retention-days: 3

.github/workflows/docker-scout.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
platform: [linux/amd64, linux/arm64]
19+
os:
20+
- linux
21+
arch:
22+
- amd64
23+
- arm64
2024

2125
steps:
2226
- name: Login to Docker Hub
@@ -27,8 +31,7 @@ jobs:
2731

2832
- name: Prepare environment
2933
run: |
30-
echo "PLATFORM=${{ matrix.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
31-
echo "DOCKER_FN=docker/${{ matrix.platform }}.tar" | tr '/' '-' | tee -a $GITHUB_ENV
34+
echo "DOCKER_FN=docker/${{ matrix.os }}/${{ matrix.arch }}.tar" | tr '/' '-' | tee -a $GITHUB_ENV
3235
3336
- name: Download images
3437
uses: actions/download-artifact@v4
@@ -48,5 +51,5 @@ jobs:
4851
with:
4952
command: cves
5053
only-fixed: true
51-
platform: ${{ matrix.platform }}
52-
image: xion:${{ env.PLATFORM }}
54+
platform: ${{ matrix.os }}/${{ matrix.arch }}
55+
image: xion:${{ matrix.os }}-${{ matrix.arch }}

.github/workflows/integration-tests.yml

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ env:
1010

1111
jobs:
1212
build-integration-tests:
13-
runs-on: ${{ matrix.runner.selector }}
13+
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || format('burnt-labs-{0}', matrix.arch) }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
runner:
18-
- selector: ubuntu-latest
19-
platform: linux/amd64
20-
# - selector: burnt-labs-arm64
21-
# platform: linux/arm64
17+
os:
18+
- linux
19+
arch:
20+
- amd64
21+
# - arm64
2222
steps:
2323
- name: checkout
2424
uses: actions/checkout@v4
@@ -28,7 +28,7 @@ jobs:
2828
- name: Prepare Environment
2929
run: |
3030
sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod | tee -a $GITHUB_ENV
31-
echo "PLATFORM=${{ matrix.runner.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
31+
echo "PLATFORM=${{ matrix.os }}/${{ matrix.arch }}" | tr '/' '-' | tee -a $GITHUB_ENV
3232
3333
- name: Set up Go
3434
uses: actions/setup-go@v5
@@ -44,8 +44,9 @@ jobs:
4444
- name: Upload binary
4545
uses: actions/upload-artifact@v4
4646
with:
47-
name: test-${{ env.PLATFORM }}
47+
name: test-${{ matrix.os }}-${{ matrix.arch }}
4848
path: integration_tests/integration_tests.test
49+
if-no-files-found: error
4950
retention-days: 3
5051

5152
- name: find wasmvm lib
@@ -59,37 +60,38 @@ jobs:
5960
with:
6061
name: ${{ env.WASM_FILE }}
6162
path: ${{ env.WASM_PATH }}
63+
if-no-files-found: error
6264
retention-days: 3
6365

6466
interchain-tests:
65-
runs-on: ${{ matrix.runner.selector }}
67+
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || format('burnt-labs-{0}', matrix.arch) }}
6668
needs: build-integration-tests
6769
strategy:
6870
fail-fast: false
6971
matrix:
70-
runner:
71-
- selector: ubuntu-latest
72-
platform: linux/amd64
73-
# - selector: burnt-labs-arm64
74-
# platform: linux/arm64
72+
os:
73+
- linux
74+
arch:
75+
- amd64
76+
# - arm64
7577
test_type:
76-
- "DungeonTransferBlock"
77-
- "XionSendPlatformFee"
78-
- "MintModuleNoInflationNoFees"
79-
- "MintModuleInflationHighFees"
80-
- "MintModuleInflationLowFees"
81-
- "JWTAbstractAccount"
82-
- "XionSendPlatformFee"
83-
- "XionAbstractAccount"
84-
- "WebAuthNAbstractAccount"
85-
- "XionMinimumFeeDefault"
86-
- "XionMinimumFeeZero"
87-
- "XionTokenFactory"
88-
- "XionAbstractAccountJWTCLI"
89-
- "TreasuryContract"
90-
- "TreasuryMulti"
91-
- "SingleAbstractAccountMigration"
92-
# - "Simulate"
78+
- "DungeonTransferBlock"
79+
- "XionSendPlatformFee"
80+
- "MintModuleNoInflationNoFees"
81+
- "MintModuleInflationHighFees"
82+
- "MintModuleInflationLowFees"
83+
- "JWTAbstractAccount"
84+
- "XionSendPlatformFee"
85+
- "XionAbstractAccount"
86+
- "WebAuthNAbstractAccount"
87+
- "XionMinimumFeeDefault"
88+
- "XionMinimumFeeZero"
89+
- "XionTokenFactory"
90+
- "XionAbstractAccountJWTCLI"
91+
- "TreasuryContract"
92+
- "TreasuryMulti"
93+
- "SingleAbstractAccountMigration"
94+
# - "Simulate"
9395

9496
steps:
9597
- name: checkout
@@ -107,13 +109,13 @@ jobs:
107109
OS: ${{ steps.string.outputs.lowercase }}
108110
run: |
109111
mkdir -p lib
110-
echo "PLATFORM=${{ matrix.runner.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
112+
echo "PLATFORM=${{ matrix.os }}/${{ matrix.arch }}" | tr '/' '-' | tee -a $GITHUB_ENV
111113
112114
- name: Download integration test binary
113115
uses: actions/download-artifact@v4
114116
with:
115117
path: integration_tests
116-
pattern: test-${{ env.PLATFORM }}
118+
pattern: test-${{ matrix.os }}-${{ matrix.arch }}
117119
merge-multiple: true
118120

119121
- name: Download wasm vm lib
@@ -127,7 +129,7 @@ jobs:
127129
uses: actions/download-artifact@v4
128130
with:
129131
path: ${{ runner.temp }}
130-
pattern: heighliner-${{ env.PLATFORM }}.tar
132+
pattern: heighliner-${{ matrix.os }}-${{ matrix.arch }}.tar
131133
merge-multiple: true
132134

133135
- name: Load images
@@ -143,4 +145,4 @@ jobs:
143145
./integration_tests/integration_tests.test -test.failfast -test.v -test.run Test${{ matrix.test_type }}
144146
env:
145147
E2E_SKIP_CLEANUP: true
146-
XION_IMAGE: heighliner:${{ env.PLATFORM }}
148+
XION_IMAGE: heighliner:${{ matrix.os }}-${{ matrix.arch }}

0 commit comments

Comments
 (0)