Skip to content

Commit

Permalink
artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Apr 16, 2021
1 parent 5000e36 commit e3f28a4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8 #install the python needed
- name: generate release artifacts
run: |
python release.py
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: Release.txt
files: target/release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ Infrastructure-as-code repo to activate and bootstrap tezos testnets in a repeat

## Currently deployed testnets

Deployment of new testnets is performed with Github Releases.

The Release Notes has a list of currently deployed testnets, with URLs to connect to them.
31 changes: 31 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/python
import json
import os
import json
import yaml

os.makedirs("target/release", exist_ok=True)

for network in [ f.path for f in os.scandir(".") if f.is_dir() and f.path[:3] != "./." and f.path != "./node_modules" and f.path != "./target" ]:
with open(f"{network}/values.yaml", 'r') as stream:
network_values = yaml.safe_load(stream)
node_config_network = network_values["node_config_network"]
network_name = network.split('./')[1]

# genesis_pubkey is the public key associated with the $TEZOS_BAKING_KEY private key in github secrets
# TODO: generate it dynamically based on privkey
genesis_pubkey = "edpkuix6Lv8vnrz6uDe1w8uaXY7YktitAxn6EHdy2jdzq5n5hZo94n"

network_config = { "sandboxed_chain_name": "SANDBOXED_TEZOS",
"chain_name": node_config_network["chain_name"],
"default_bootstrap_peers": [ f"{network_name}.tznode.net" ],
"genesis": node_config_network["genesis"],
"genesis_parameters": {
"values": {
"genesis_pubkey": genesis_pubkey
}
}
}

with open(f"target/release/{network_name}", "w") as out_file:
print(json.dumps(network_config), file=out_file)

0 comments on commit e3f28a4

Please sign in to comment.