-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from christopherbrumm/feat/no-release
Feat/no release
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |