Skip to content

Commit c784977

Browse files
committed
use goreleaser for build/release
1 parent 509cc6f commit c784977

18 files changed

+1214
-213
lines changed

.github/workflows/binaries-linux.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build-binaries:
1010
name: Build xiond-${{ matrix.os }}-${{ matrix.arch }}
11-
runs-on: ${{ matrix.arch == 'arm64' && format('burnt-labs-{0}', matrix.arch) || 'ubuntu-latest' }}
11+
runs-on: ${{ matrix.arch == 'arm64' && format('github-{0}', matrix.arch) || 'ubuntu-latest' }}
1212

1313
strategy:
1414
fail-fast: false

.github/workflows/binaries-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build-integration:
1010
name: Build test-${{ matrix.os }}-${{ matrix.arch }}
11-
runs-on: ${{ matrix.arch == 'arm64' && format('burnt-labs-{0}', matrix.arch) || 'ubuntu-latest' }}
11+
runs-on: ${{ matrix.arch == 'arm64' && format('github-{0}', matrix.arch) || 'ubuntu-latest' }}
1212

1313
strategy:
1414
fail-fast: false

.github/workflows/create-release.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
build-release:
7979
name: Build Release
8080
needs:
81+
- build-linux
8182
- lint
8283
- update-swagger
8384
- unit-tests
@@ -111,3 +112,9 @@ jobs:
111112
# - build-release-info
112113
# uses: burnt-labs/xion/.github/workflows/update-networks.yaml@workflows/main
113114
# secrets: inherit
115+
116+
verify-installers:
117+
name: Verify Package Installers
118+
needs: build-release
119+
uses: burnt-labs/xion/.github/workflows/verify-installers.yaml@workflows/main
120+
secrets: inherit

.github/workflows/docker-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build-docker-images:
1010
name: Build ${{ matrix.os }}/${{ matrix.arch }}
11-
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || format('burnt-labs-{0}', matrix.arch) }}
11+
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || format('github-{0}', matrix.arch) }}
1212

1313
strategy:
1414
fail-fast: false

.github/workflows/goreleaser.yaml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,64 @@ jobs:
3838
with:
3939
go-version: stable
4040

41+
- name: Import package signing GPG key
42+
id: import_pkg_gpg
43+
uses: crazy-max/ghaction-import-gpg@v6
44+
with:
45+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
46+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
47+
48+
- name: Save GPG and RSA keys
49+
run: |
50+
echo "${{ secrets.GPG_PRIVATE_KEY }}" > /home/runner/.gnupg/sign.asc
51+
echo "${{ secrets.PEM_PRIVATE_KEY }}" > /home/runner/.gnupg/sign.pem
52+
4153
- name: Run GoReleaser
4254
uses: goreleaser/goreleaser-action@v6
4355
env:
56+
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
4457
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
GPG_KEY_ID: ${{ steps.import_pkg_gpg.outputs.keyid }}
59+
GPG_KEY_PATH: /home/runner/.gnupg/sign.asc
60+
GPG_FINGERPRINT: ${{ steps.import_pkg_gpg.outputs.fingerprint }}
61+
GORELEASER_ACCESS_TOKEN: ${{ secrets.GORELEASER_ACCESS_TOKEN }}
4562
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
46-
CLOUDSMITH_TOKEN: ${{ secrets.CLOUDSMITH_TOKEN }}
63+
NFPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
64+
PEM_KEY_PATH: /home/runner/.gnupg/sign.pem
4765
with:
4866
distribution: goreleaser-pro
4967
version: "~> v2"
5068
args: release --config .goreleaser/release.yaml
69+
70+
fix-pr:
71+
runs-on: ubuntu-latest
72+
needs: build-release
73+
permissions:
74+
contents: write
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
with:
80+
repository: burnt-labs/homebrew-xion
81+
fetch-depth: 0
82+
ref: xiond-${{ github.ref_name }}
83+
token: ${{ secrets.GORELEASER_ACCESS_TOKEN }}
84+
85+
- name: Import github siginig GPG key
86+
id: import_git_gpg
87+
uses: crazy-max/ghaction-import-gpg@v6
88+
with:
89+
gpg_private_key: ${{ secrets.GPG_GIT_PRIVATE_KEY }}
90+
passphrase: ${{ secrets.GPG_GIT_PASSPHRASE }}
91+
git_commit_gpgsign: true
92+
git_committer_name: developer
93+
git_committer_email: [email protected]
94+
git_user_signingkey: true
95+
96+
- name: Squash Commit and Sign
97+
run: |
98+
git reset origin/main --soft
99+
git add -A
100+
git commit -S -m "xiond-${{ github.ref_name }}"
101+
git push -f

.github/workflows/integration-tests.yaml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,28 @@ jobs:
2020
- amd64
2121
# - arm64
2222
test_type:
23-
- "DungeonTransferBlock"
24-
- "XionSendPlatformFee"
25-
- "MintModuleNoInflationNoFees"
26-
- "MintModuleInflationNoFees"
27-
- "MintModuleInflationHighFees"
28-
- "MintModuleInflationLowFees"
29-
- "JWTAbstractAccount"
30-
- "XionSendPlatformFee"
31-
- "XionAbstractAccount"
32-
- "WebAuthNAbstractAccount"
33-
- "XionMinimumFeeDefault"
34-
- "XionMinimumFeeZero"
35-
- "XionTokenFactory"
36-
- "XionAbstractAccountJWTCLI"
37-
- "TreasuryContract"
38-
- "TreasuryMulti"
39-
- "SingleAbstractAccountMigration"
40-
- "Simulate"
41-
- "UpdateTreasuryConfigsWithLocalAndURL"
42-
- "UpdateTreasuryConfigsWithAALocalAndURL"
23+
- "DungeonTransferBlock"
24+
- "JWTAbstractAccount"
25+
- "MintModuleInflationHighFees"
26+
- "MintModuleInflationLowFees"
27+
- "MintModuleInflationNoFees"
28+
- "MintModuleNoInflationNoFees"
29+
- "Simulate"
30+
- "SingleAbstractAccountMigration"
31+
- "TreasuryContract"
32+
- "TreasuryMulti"
33+
- "UpdateTreasuryConfigsWithAALocalAndURL"
34+
- "UpdateTreasuryConfigsWithLocalAndURL"
35+
- "UpdateTreasuryContractParams"
36+
- "WebAuthNAbstractAccount"
37+
- "XionAbstractAccount"
38+
- "XionAbstractAccountJWTCLI"
39+
- "XionClientEvent"
40+
- "XionMinimumFeeDefault"
41+
- "XionMinimumFeeZero"
42+
- "XionSendPlatformFee"
43+
- "XionTokenFactory"
44+
# - "XionUpgradeNetwork" # broken
4345

4446
steps:
4547
- name: checkout

.github/workflows/publish-types.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
node-version: 18
1919
registry-url: 'https://registry.npmjs.org'
2020

21+
- name: Set permissions for TypeScript directory
22+
run: sudo chmod -R 777 client/ts
23+
2124
- name: Generate TypeScript definitions
2225
run: make proto-gen-ts
2326

@@ -45,4 +48,4 @@ jobs:
4548
run: |
4649
npm publish
4750
env:
48-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Verify Installers
2+
3+
# reusable workflow, do not add triggers
4+
on:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
apt-install:
10+
runs-on: ${{ format('github-{0}', matrix.arch) }}
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
arch:
16+
- amd64
17+
- arm64
18+
19+
steps:
20+
- name: Download the repository key
21+
run: |
22+
wget -qO - https://packages.burnt.com/apt/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/burnt-keyring.gpg
23+
24+
- name: Add to apt sources list
25+
run: |
26+
echo "deb [signed-by=/usr/share/keyrings/burnt-keyring.gpg] http://packages.burnt.com/apt /" | sudo tee /etc/apt/sources.list.d/burnt.list
27+
28+
- name: Update sources
29+
run: |
30+
sudo apt update
31+
32+
- name: Install xiond
33+
run: |
34+
sudo apt install -y xiond
35+
36+
- name: Verify xiond installation
37+
run: |
38+
xiond version --long
39+
40+
rpm-install:
41+
runs-on: ${{ format('github-{0}', matrix.arch) }}
42+
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
arch:
47+
- amd64
48+
- arm64
49+
50+
container:
51+
image: redhat/ubi8:latest
52+
options: --user root
53+
steps:
54+
- name: Download the repository key
55+
run: |
56+
rpm --import https://packages.burnt.com/yum/gpg.key
57+
58+
- name: Add to yum repos list
59+
run: |
60+
printf "[burnt]\nname=Burnt Repo\nenabled=1\nbaseurl=https://packages.burnt.com/yum/\n" | tee /etc/yum.repos.d/burnt.repo
61+
62+
- name: Install xiond
63+
run: |
64+
yum install xiond -y
65+
66+
- name: Verify xiond installation
67+
run: |
68+
xiond version --long
69+
70+
apk-install:
71+
runs-on: ${{ format('github-{0}', matrix.arch) }}
72+
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
arch:
77+
- amd64
78+
- arm64
79+
80+
container:
81+
image: alpine:latest
82+
options: --user root
83+
steps:
84+
- name: Download the repository key
85+
run: |
86+
wget -qO - https://alpine.fury.io/burnt/[email protected] | tee /etc/apk/keys/[email protected]
87+
88+
- name: Add to apk repos list
89+
run: |
90+
echo "https://alpine.fury.io/burnt" >> /etc/apk/repositories
91+
92+
- name: Install xiond
93+
run: |
94+
apk update && apk add xiond
95+
96+
- name: Verify xiond installation
97+
run: |
98+
xiond version --long

.goreleaser/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ builds:
6060
- -trimpath
6161
env:
6262
- CGO_ENABLED=1
63-
- CGO_LDFLAGS='-L./dist/lib'
64-
- LIB_PATH=./dist/lib
63+
- CGO_LDFLAGS='-L./dist/lib-{{ .Arch}}'
64+
- LIB_PATH=./dist/lib-{{ .Arch }}
6565
- >-
6666
{{- if eq .Os "darwin" }}MACOSX_DEPLOYMENT_TARGET=10.12{{- end }}
6767
- >-

.goreleaser/release.yaml

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
22

3+
# using this file requires goreleaser pro
4+
35
version: 2
46

57
project_name: xiond
@@ -46,45 +48,71 @@ source:
4648
enabled: true
4749

4850
archives:
49-
# brew does not work without zip
50-
- id: xiond
51-
formats: [tgz, zip]
51+
- id: tgz
52+
formats: [tar.gz]
5253
meta: false
5354
wrap_in_directory: false
5455
strip_binary_directory: false
5556

57+
# docs: https://goreleaser.com/customization/checksum/
58+
checksum:
59+
name_template: "xiond-{{ .Version }}-checksums.txt"
60+
algorithm: sha256
61+
5662
nfpms:
5763
- if: '{{ eq .Os "linux" }}'
5864
formats:
5965
- apk
6066
- deb
6167
- rpm
68+
apk:
69+
signature:
70+
key_file: "{{ .Env.PEM_KEY_PATH }}"
71+
deb:
72+
signature:
73+
key_file: "{{ .Env.GPG_KEY_PATH }}"
74+
rpm:
75+
signature:
76+
key_file: "{{ .Env.GPG_KEY_PATH }}"
77+
78+
# not used
79+
# signs:
80+
# - artifacts: package
81+
# cmd: gpg2
82+
# #- args: ["-u", "<key id, fingerprint, email, ...>", "--output", "${signature}", "--detach-sign", "${artifact}"]
83+
84+
# docs https://goreleaser.com/customization/fury/
85+
furies:
86+
- account: burnt
6287

6388
# Docs: https://goreleaser.com/customization/homebrew/
6489
brews:
6590
- alternative_names:
6691
- xiond@{{ .Version }}
6792
- xiond@{{ .Major }}
6893
# Repository to push the generated files to.
69-
skip_upload: true
94+
skip_upload: false
95+
ids:
96+
- tgz
97+
test: |
98+
system "#{bin}/xiond version"
99+
commit_author:
100+
name: developer
101+
102+
directory: Formula
70103
repository:
71104
owner: burnt-labs
72-
name: xion-homebrew
73-
branch: main
74-
75-
# Docs: https://goreleaser.com/customization/cloudsmith/
76-
cloudsmiths:
77-
- organization: burnt-labs
78-
repository: xiond
79-
distributions:
80-
deb: "any-distro/any-version"
81-
alpine: "alpine/any-version"
82-
# rpm: any-distro/any-version"
105+
name: homebrew-xion
106+
branch: "{{.ProjectName}}-v{{.Version}}"
107+
token: "{{ .Env.GORELEASER_ACCESS_TOKEN }}"
108+
pull_request:
109+
enabled: true
110+
draft: false
111+
base:
112+
owner: burnt-labs
113+
name: homebrew-xion
114+
branch: main
83115

84-
# docs: https://goreleaser.com/customization/checksum/
85-
checksum:
86-
name_template: "xiond-{{ .Version }}-checksums.txt"
87-
algorithm: sha256
88116

89117
# Docs: https://goreleaser.com/customization/changelog/
90118
# changelog:
@@ -117,3 +145,4 @@ release:
117145
make_latest: false
118146
# disable: "{{ .Env.SKIP_GITHUB_RELEASE }}"
119147
mode: keep-existing
148+

0 commit comments

Comments
 (0)