Skip to content

Commit 44d188d

Browse files
author
Kostas Demiris
committed
test the burnt-labs/chain-registry new branch creation
1 parent 1385713 commit 44d188d

File tree

1 file changed

+47
-46
lines changed

1 file changed

+47
-46
lines changed

.github/workflows/sync_to_cosmos_chain_registry.yaml

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -184,59 +184,60 @@ jobs:
184184
set -Eeuo pipefail
185185
echo "version_tag=$(echo "$version_info" | jq -r '.tag')" >> $GITHUB_OUTPUT
186186
echo "version_name=$(echo "$version_info" | jq -r '.name')" >> $GITHUB_OUTPUT
187+
echo "version_info=$version_info"
187188
188-
# - name: Setup Git and Create Branch
189-
# id: create_branch
190-
# env:
191-
# NEW_BRANCH: "xion/mainnet-release-${{ steps.version_info.outputs.version_tag }}"
192-
# run: |
193-
# set -Eeuo pipefail
189+
- name: Setup Git and Create Branch
190+
id: create_branch
191+
env:
192+
NEW_BRANCH: "xion/mainnet-release-${{ steps.version_info.outputs.version_tag }}"
193+
run: |
194+
set -Eeuo pipefail
194195
195-
# # Configure git
196-
# git config user.name "github-actions[bot]"
197-
# git config user.email "github-actions[bot]@users.noreply.github.com"
196+
# Configure git
197+
git config user.name "github-actions[bot]"
198+
git config user.email "github-actions[bot]@users.noreply.github.com"
198199
199-
# # Create/checkout the branch
200-
# if git show-ref --verify --quiet "refs/heads/${NEW_BRANCH}"; then
201-
# echo "Branch $NEW_BRANCH already exists, checking it out"
202-
# git checkout ${NEW_BRANCH}
203-
# else
204-
# echo "Creating new branch $NEW_BRANCH from xion/main"
205-
# git checkout -b $NEW_BRANCH
206-
# fi
207-
# echo "new_branch=$NEW_BRANCH" >> $GITHUB_OUTPUT
200+
# Create/checkout the branch
201+
if git show-ref --verify --quiet "refs/heads/${NEW_BRANCH}"; then
202+
echo "Branch $NEW_BRANCH already exists, checking it out"
203+
git checkout ${NEW_BRANCH}
204+
else
205+
echo "Creating new branch $NEW_BRANCH from xion/main"
206+
git checkout -b $NEW_BRANCH
207+
fi
208+
echo "new_branch=$NEW_BRANCH" >> $GITHUB_OUTPUT
208209
209-
# - name: Update xion versions.json
210-
# env:
211-
# VERSIONS_FILE: "xion/versions.json"
212-
# VERSION_NAME: ${{ steps.version_info.outputs.version_name }}
213-
# run: |
214-
# set -Eeuo pipefail
210+
- name: Update xion versions.json
211+
env:
212+
VERSIONS_FILE: "xion/versions.json"
213+
VERSION_NAME: ${{ steps.version_info.outputs.version_name }}
214+
run: |
215+
set -Eeuo pipefail
215216
216-
# # Check if version already exists and update or append
217-
# if jq -e --arg name "$VERSION_NAME" '.versions[] | select(.name == $name)' "$VERSIONS_FILE" > /dev/null; then
218-
# echo "Version $VERSION_NAME already exists, updating..."
219-
# jq --arg name "$VERSION_NAME" --argjson new "$version_info" '
220-
# .versions = (.versions | map(if .name == $name then . + $new else . end))
221-
# ' "$VERSIONS_FILE" > "$VERSIONS_FILE.tmp" && mv "$VERSIONS_FILE.tmp" "$VERSIONS_FILE"
222-
# else
223-
# echo "Version $VERSION_NAME does not exist, appending..."
224-
# jq --arg name "$VERSION_NAME" --argjson new "$version_info" '
225-
# .versions += [$new]
226-
# ' "$VERSIONS_FILE" > "$VERSIONS_FILE.tmp" && mv "$VERSIONS_FILE.tmp" "$VERSIONS_FILE"
227-
# fi
217+
# Check if version already exists and update or append
218+
if jq -e --arg name "$VERSION_NAME" '.versions[] | select(.name == $name)' "$VERSIONS_FILE" > /dev/null; then
219+
echo "Version $VERSION_NAME already exists, updating..."
220+
jq --arg name "$VERSION_NAME" --argjson new "$version_info" '
221+
.versions = (.versions | map(if .name == $name then . + $new else . end))
222+
' "$VERSIONS_FILE" > "$VERSIONS_FILE.tmp" && mv "$VERSIONS_FILE.tmp" "$VERSIONS_FILE"
223+
else
224+
echo "Version $VERSION_NAME does not exist, appending..."
225+
jq --arg name "$VERSION_NAME" --argjson new "$version_info" '
226+
.versions += [$new]
227+
' "$VERSIONS_FILE" > "$VERSIONS_FILE.tmp" && mv "$VERSIONS_FILE.tmp" "$VERSIONS_FILE"
228+
fi
228229
229-
# - name: Update xion chain.json
230-
# env:
231-
# CHAIN_FILE: "xion/chain.json"
232-
# run: |
233-
# set -Eeuo pipefail
230+
- name: Update xion chain.json
231+
env:
232+
CHAIN_FILE: "xion/chain.json"
233+
run: |
234+
set -Eeuo pipefail
234235
235-
# # Update chain.json
236-
# echo "Updating chain.json with new version info"
237-
# jq --argjson new "$version_info" '
238-
# .codebase += ($new | del(.name))
239-
# ' "$CHAIN_FILE" > "$CHAIN_FILE.tmp" && mv "$CHAIN_FILE.tmp" "$CHAIN_FILE"
236+
# Update chain.json
237+
echo "Updating chain.json with new version info"
238+
jq --argjson new "$version_info" '
239+
.codebase += ($new | del(.name))
240+
' "$CHAIN_FILE" > "$CHAIN_FILE.tmp" && mv "$CHAIN_FILE.tmp" "$CHAIN_FILE"
240241
241242
# - name: Commit and push changes
242243
# run: |

0 commit comments

Comments
 (0)