Skip to content

Commit 024f9f8

Browse files
wehappyfewKostas Demiris2xburnt
committed
Feat: DO64 - update chain registry on release (#14)
* test the workflow trigger * test the workflow trigger * test the workflow trigger * test the PR for the updated versions.json * added step to update the mainnet versions.json * fixed test cat at the end of the steps * ready for PR * modify workflow * rebase --------- Co-authored-by: Kostas Demiris <[email protected]> Co-authored-by: TwiceBurnt <[email protected]>
1 parent f1250d3 commit 024f9f8

File tree

7 files changed

+139
-27
lines changed

7 files changed

+139
-27
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Update Chain Registry Versions
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_info:
7+
description: "Version information in JSON format"
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
version_info:
13+
description: "Version information in JSON format"
14+
required: true
15+
type: string
16+
17+
jobs:
18+
update-versions:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
strategy:
24+
matrix:
25+
network:
26+
- name: testnet
27+
versions_file: "public/chain-registry/testnets/xiontestnet2/versions.json"
28+
chain_file: "public/chain-registry/testnets/xiontestnet2/chain.json"
29+
- name: mainnet
30+
versions_file: "public/chain-registry/xion/versions.json"
31+
chain_file: "public/chain-registry/xion/chain.json"
32+
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0 # Ensure we can create branches
38+
39+
- name: Extract version name
40+
id: version_info
41+
run: |
42+
echo "VERSION_NAME=$(echo '${{ inputs.version_info }}' | jq -r '.name')" >> $GITHUB_ENV
43+
echo "VERSION_TAG=$(echo '${{ inputs.version_info }}' | jq -r '.tag')" >> $GITHUB_ENV
44+
45+
- name: Create new branch
46+
run: |
47+
git config --global user.name "github-actions[bot]"
48+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
49+
git checkout -b upgrade/${{ matrix.network.name }}-${{ env.VERSION_TAG }}
50+
git push --set-upstream origin upgrade/${{ matrix.network.name }}-${{ env.VERSION_TAG }}
51+
52+
- name: Update file ${{ matrix.network.name }}
53+
id: update_json
54+
run: |
55+
# Set variables based on network
56+
VERSIONS_FILE="${{ matrix.network.versions_file }}"
57+
CHAIN_FILE="${{ matrix.network.chain_file }}"
58+
59+
60+
# Check if version already exists and update or append
61+
if jq -e --arg name "$VERSION_NAME" '.versions[] | select(.name == $name)' "$VERSIONS_FILE" > /dev/null; then
62+
echo "Version $VERSION_NAME already exists, updating..."
63+
jq --arg name "$VERSION_NAME" --argjson new '${{ inputs.version_info }}' '
64+
.versions = (.versions | map(if .name == $name then $new else . end))
65+
' "$VERSIONS_FILE" > temp.json
66+
else
67+
echo "Version $VERSION_NAME does not exist, appending..."
68+
jq --arg name "$VERSION_NAME" --argjson new '${{ inputs.version_info }}' '
69+
.versions += [$new]
70+
' "$VERSIONS_FILE" > temp.json
71+
fi
72+
73+
mv temp.json "$VERSIONS_FILE"
74+
cat $VERSIONS_FILE
75+
76+
# Update chain.json
77+
echo "Updating chain.json with version tag: $VERSION_TAG"
78+
jq --arg version_tag "$VERSION_TAG" '.codebase.tag = $version_tag | .codebase.recommended_version = $version_tag' "$CHAIN_FILE" > temp_chain.json
79+
mv temp_chain.json "$CHAIN_FILE"
80+
cat "$CHAIN_FILE"
81+
82+
- name: Commit and push changes
83+
id: commit_changes
84+
run: |
85+
git add "${{ matrix.network.chain_file }}" "${{ matrix.network.versions_file }}"
86+
87+
# Check if there are changes to commit
88+
if git diff --staged --quiet; then
89+
echo "No changes to commit"
90+
echo "changes_made=false" >> $GITHUB_OUTPUT
91+
else
92+
git commit -m "upgrade: upgrade ${{ matrix.network.name }} to ${{ env.VERSION_TAG }} in versions.json and chain.json"
93+
git push origin upgrade/${{ matrix.network.name }}-${{ env.VERSION_TAG }}
94+
echo "changes_made=true" >> $GITHUB_OUTPUT
95+
fi
96+
97+
- name: Create Pull Request - ${{ matrix.network.name }}
98+
env:
99+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
run: |
101+
gh pr create \
102+
--base main \
103+
--title "upgrade: upgrade ${{ env.VERSION_TAG }} to ${{ matrix.network.name }} chain registry" \
104+
--body "Updates ${{ matrix.network.name }} versions.json and chain.json with ${{ env.VERSION_TAG }} release information" \
105+
--head "upgrade/${{ matrix.network.name }}-${{ env.VERSION_TAG }}" \
106+
--reviewer "2xburnt" \
107+
--reviewer "wehappyfew"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ coverage
3232
# wrangler files
3333
.wrangler
3434
.dev.vars*
35+
36+
37+
# github workflows
38+
.github/workflows/test_workflow.yaml

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"prebuild": "node scripts/generate-list.js",
98
"build": "run-p type-check \"build-only {@}\" --",
109
"preview": "npm run build && wrangler dev",
1110
"build-only": "vite build",

public/chain-registry/testnets/xiontestnet2/chain.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
},
4343
"codebase": {
4444
"git_repo": "https://github.com/burnt-labs/xion",
45-
"tag": "v19.0.1",
46-
"recommended_version": "v19.0.1",
45+
"tag": "v19.0.2",
46+
"recommended_version": "v19.0.2",
4747
"language": {
4848
"type": "go",
4949
"version": "v1.23"
5050
},
5151
"binaries": {
52-
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_amd64.tar.gz?checksum=sha256:f350e2ab0cc08c18acce0d6518bd4f29ac88f1c331eb10d3ca43ec3e74103521",
53-
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_arm64.tar.gz?checksum=sha256:9c2944de98c54f4e8517259d0782daca4c43900887b7d7c19044ba75b6e2976d",
54-
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_amd64.tar.gz?checksum=sha256:5350ccf4fb83f086f772ceebd8a1c3788c2fa64ad1976d92052842e23a1977c3",
55-
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_arm64.tar.gz?checksum=sha256:efed79d4b240c6edaa4488b54e7efcbff89313c0f0ed6e1682dab0f1d97315c2"
52+
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_amd64.tar.gz?checksum=sha256:edda13aec2274f1eceb933874a885d055b14acbbe0de21ba61ed9c25c64813d6",
53+
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_arm64.tar.gz?checksum=sha256:7b94d2fdf1baa1d3dff4f947858a2bac684257be27f8bf179fb973ee8dd4fdb8",
54+
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_amd64.tar.gz?checksum=sha256:6072ce81d08f77f98e2d2ae7726007eca18579ea2b1690b5f76b4df782690dcb",
55+
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_arm64.tar.gz?checksum=sha256:0a55360653b596da5ace43c3b4a3fef6c9785bfe0e73405f591768b449af0e70"
5656
},
5757
"sdk": {
5858
"type": "cosmos",

public/chain-registry/testnets/xiontestnet2/versions.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,11 @@
188188
},
189189
{
190190
"name": "v19",
191-
"tag": "v19.0.1",
192-
"recommended_version": "v19.0.1",
191+
"tag": "v19.0.2",
192+
"recommended_version": "v19.0.2",
193193
"compatible_versions": [
194-
"v19.0.1"
194+
"v19.0.1",
195+
"v19.0.2"
195196
],
196197
"height": 7420000,
197198
"proposal": 37,
@@ -200,10 +201,10 @@
200201
"version": "v1.23"
201202
},
202203
"binaries": {
203-
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_amd64.tar.gz?checksum=sha256:f350e2ab0cc08c18acce0d6518bd4f29ac88f1c331eb10d3ca43ec3e74103521",
204-
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_arm64.tar.gz?checksum=sha256:9c2944de98c54f4e8517259d0782daca4c43900887b7d7c19044ba75b6e2976d",
205-
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_amd64.tar.gz?checksum=sha256:5350ccf4fb83f086f772ceebd8a1c3788c2fa64ad1976d92052842e23a1977c3",
206-
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_arm64.tar.gz?checksum=sha256:efed79d4b240c6edaa4488b54e7efcbff89313c0f0ed6e1682dab0f1d97315c2"
204+
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_amd64.tar.gz?checksum=sha256:edda13aec2274f1eceb933874a885d055b14acbbe0de21ba61ed9c25c64813d6",
205+
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_arm64.tar.gz?checksum=sha256:7b94d2fdf1baa1d3dff4f947858a2bac684257be27f8bf179fb973ee8dd4fdb8",
206+
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_amd64.tar.gz?checksum=sha256:6072ce81d08f77f98e2d2ae7726007eca18579ea2b1690b5f76b4df782690dcb",
207+
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_arm64.tar.gz?checksum=sha256:0a55360653b596da5ace43c3b4a3fef6c9785bfe0e73405f591768b449af0e70"
207208
},
208209
"sdk": {
209210
"type": "cosmos",

public/chain-registry/xion/chain.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
},
4343
"codebase": {
4444
"git_repo": "https://github.com/burnt-labs/xion",
45-
"tag": "v19.0.1",
46-
"recommended_version": "v19.0.1",
45+
"tag": "v19.0.2",
46+
"recommended_version": "v19.0.2",
4747
"language": {
4848
"type": "go",
4949
"version": "v1.23"
5050
},
5151
"binaries": {
52-
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_amd64.tar.gz?checksum=sha256:f350e2ab0cc08c18acce0d6518bd4f29ac88f1c331eb10d3ca43ec3e74103521",
53-
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_arm64.tar.gz?checksum=sha256:9c2944de98c54f4e8517259d0782daca4c43900887b7d7c19044ba75b6e2976d",
54-
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_amd64.tar.gz?checksum=sha256:5350ccf4fb83f086f772ceebd8a1c3788c2fa64ad1976d92052842e23a1977c3",
55-
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_arm64.tar.gz?checksum=sha256:efed79d4b240c6edaa4488b54e7efcbff89313c0f0ed6e1682dab0f1d97315c2"
52+
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_amd64.tar.gz?checksum=sha256:edda13aec2274f1eceb933874a885d055b14acbbe0de21ba61ed9c25c64813d6",
53+
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_arm64.tar.gz?checksum=sha256:7b94d2fdf1baa1d3dff4f947858a2bac684257be27f8bf179fb973ee8dd4fdb8",
54+
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_amd64.tar.gz?checksum=sha256:6072ce81d08f77f98e2d2ae7726007eca18579ea2b1690b5f76b4df782690dcb",
55+
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_arm64.tar.gz?checksum=sha256:0a55360653b596da5ace43c3b4a3fef6c9785bfe0e73405f591768b449af0e70"
5656
},
5757
"sdk": {
5858
"type": "cosmos",

public/chain-registry/xion/versions.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,11 @@
337337
},
338338
{
339339
"name": "v19",
340-
"tag": "v19.0.1",
341-
"recommended_version": "v19.0.1",
340+
"tag": "v19.0.2",
341+
"recommended_version": "v19.0.2",
342342
"compatible_versions": [
343-
"v19.0.1"
343+
"v19.0.1",
344+
"v19.0.2"
344345
],
345346
"height": 9150000,
346347
"proposal": 40,
@@ -349,10 +350,10 @@
349350
"version": "v1.23"
350351
},
351352
"binaries": {
352-
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_amd64.tar.gz?checksum=sha256:f350e2ab0cc08c18acce0d6518bd4f29ac88f1c331eb10d3ca43ec3e74103521",
353-
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_darwin_arm64.tar.gz?checksum=sha256:9c2944de98c54f4e8517259d0782daca4c43900887b7d7c19044ba75b6e2976d",
354-
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_amd64.tar.gz?checksum=sha256:5350ccf4fb83f086f772ceebd8a1c3788c2fa64ad1976d92052842e23a1977c3",
355-
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.1/xiond_19.0.1_linux_arm64.tar.gz?checksum=sha256:efed79d4b240c6edaa4488b54e7efcbff89313c0f0ed6e1682dab0f1d97315c2"
353+
"darwin/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_amd64.tar.gz?checksum=sha256:edda13aec2274f1eceb933874a885d055b14acbbe0de21ba61ed9c25c64813d6",
354+
"darwin/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_darwin_arm64.tar.gz?checksum=sha256:7b94d2fdf1baa1d3dff4f947858a2bac684257be27f8bf179fb973ee8dd4fdb8",
355+
"linux/amd64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_amd64.tar.gz?checksum=sha256:6072ce81d08f77f98e2d2ae7726007eca18579ea2b1690b5f76b4df782690dcb",
356+
"linux/arm64": "https://github.com/burnt-labs/xion/releases/download/v19.0.2/xiond_19.0.2_linux_arm64.tar.gz?checksum=sha256:0a55360653b596da5ace43c3b4a3fef6c9785bfe0e73405f591768b449af0e70"
356357
},
357358
"sdk": {
358359
"type": "cosmos",

0 commit comments

Comments
 (0)