Skip to content

Commit

Permalink
Merge pull request #1 from christopherbrumm/feat/no-release
Browse files Browse the repository at this point in the history
Feat/no release
  • Loading branch information
christopherbrumm authored Nov 2, 2023
2 parents 58b320c + f078cc5 commit f431a31
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/release_registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Merge Source Configs and Create Release

on:
push:
branches:
- main
paths:
- '**.yml'
pull_request:
types:
- closed

jobs:
merge_yaml:
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v2

- name: Merge Source Configs
run: python merge_configs.py
working-directory: ${{ github.workspace }}

- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
increment: patch

- name: Create a new Release
if: github.event.pull_request.merged == true || github.event.ref == 'refs/heads/main'
run: |
release_version=${{ steps.version.outputs.version }}
release_name="v$release_version"
release_body="An updated version of the KYVE Source-Registry."
release_url="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases"
# Create a release using the GitHub API
response=$(curl -X POST "$release_url" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{
"tag_name": "'"$release_version"'",
"name": "'"$release_name"'",
"body": "'"$release_body"'"
}')
# Upload the merged YAML file as an asset
upload_url=$(echo "$response" | jq -r .upload_url)
upload_url=${upload_url/\{?name,label\}/}
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@registry.yml" \
"$upload_url?name=registry.yml"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# KYVE - Source Registry

The **Source Registry** serves as the reference for all launched pools on the KYVE Network, covering both the Mainnet `kyve-1` and Testnet `kaon-1`. It provides comprehensive information about the launched pools of a specific chain, with a primary focus on listing the essential `block_source_id` and `state_source_id`. Whether you are a KYVE Network participant or developer, this repository is your go-to resource for staying informed about the network's pool configurations and statuses.
The **Source Registry** serves as the reference for all launched pools on the KYVE Network, covering both the Mainnet `kyve-1` and Testnet `kaon-1`. It provides comprehensive information about the launched sources of a specific chain, with a primary focus on listing the essential `block_source_id` and `state_source_id`. Whether you are a KYVE Network participant or developer, this repository is your go-to resource for staying informed about the network's pool configurations and statuses.
17 changes: 17 additions & 0 deletions merge_configs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
import yaml

merged_config = {}

# Iterate through all config.yml files
for root, dirs, files in os.walk("."):
for file in files:
if file == "config.yml":
chain_id = os.path.basename(root)
with open(os.path.join(root, file), 'r') as stream:
config = yaml.safe_load(stream)
merged_config[chain_id] = config

# Write the merged config to a new file
with open("registry.yml", "w") as output_file:
yaml.dump(merged_config, output_file)

0 comments on commit f431a31

Please sign in to comment.