Scheduled Release #32543
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
name: Scheduled Release | |
on: | |
schedule: | |
- cron: "10,40 * * * *" | |
workflow_dispatch: | |
jobs: | |
check_genesis: | |
name: Check genesis time for next release | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
outputs: | |
can_release: ${{ steps.can_release.outputs.can_release }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check genesis time | |
run: | | |
echo "can_release=$(bash ./scripts/check_can_release.sh | tr -d '\n')" >> $GITHUB_OUTPUT | |
id: can_release | |
- name: Cancel workflow if nothing to do | |
if: steps.can_release.outputs.can_release != 'true' | |
run: | | |
gh api repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/cancel -X POST | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_release: | |
name: Build Release Config | |
needs: [check_genesis] | |
if: needs.check_genesis.outputs.can_release == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build testnet configs | |
run: bash ./scripts/build-genesis.sh | |
- name: Build validator names | |
run: bash ./scripts/build-validator-names.sh | |
- name: Build bootnodes | |
run: bash ./scripts/build-bootnodes.sh | |
- name: Build nodevars.env | |
run: bash ./scripts/build-nodevars.sh | |
- name: Build legacy configs | |
run: bash ./scripts/build-legacy-config.sh | |
- name: Check all generated configs | |
run: bash ./scripts/check-genesis.sh | |
- name: Get ITERATION_NUMBER as version | |
run: | | |
echo "iteration=$(cat values.env | grep 'ITERATION_NUMBER' | sed 's/.*ITERATION_NUMBER=\"\([0-9]*\)\"/\1/g' | tr -d '\n')" >> $GITHUB_OUTPUT | |
echo "release=$(cat ./dist/retention.vars | grep 'ITERATION_RELEASE' | sed 's/.*ITERATION_RELEASE=\"\(.*\)\"/\1/g' | tr -d '\n')" >> $GITHUB_OUTPUT | |
genesis_time=$(cat values.env | grep 'GENESIS_TIMESTAMP' | sed 's/.*GENESIS_TIMESTAMP=\"\([0-9]*\)\"/\1/g' | tr -d '\n') | |
echo "genesis_time=$genesis_time" >> $GITHUB_OUTPUT | |
echo "genesis_date=$(date -d @$genesis_time)" >> $GITHUB_OUTPUT | |
echo "chainid=$(cat values.env | grep 'CHAIN_ID' | sed 's/.*CHAIN_ID=\"\([0-9]*\)\"/\1/g' | tr -d '\n')" >> $GITHUB_OUTPUT | |
echo "reset_time=$(cat values.env | grep 'GENESIS_INTERVAL' | sed 's/.*GENESIS_INTERVAL=\"\([0-9]*\)\"/\1/g' | tr -d '\n')" >> $GITHUB_OUTPUT | |
id: version | |
- name: Create release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: "${{ steps.version.outputs.release }}" | |
tag_name: "${{ steps.version.outputs.release }}" | |
body: | | |
ChainId: ${{ steps.version.outputs.chainid }} | |
Genesis Time: ${{ steps.version.outputs.genesis_time }} (${{ steps.version.outputs.genesis_date }}) | |
Reset Interval: ${{ steps.version.outputs.reset_time }} | |
| Release File | Description | | |
| ------------- | ------------- | | |
| genesis.json | Execution Layer Genesis | | |
| config.yaml | Consensus Layer Config | | |
| genesis.ssz | Consensus Layer Genesis | | |
| network-config.tar.gz | Ephemery network config files (standardized testnet layout) | | |
| testnet-all.tar.gz | Legacy genesis config structure (`testnet` directory) | | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Pack testnet configs | |
run: cd dist && tar cfz network-config.tar.gz * | |
- name: Upload full config artifact | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/network-config.tar.gz | |
asset_name: network-config.tar.gz | |
asset_content_type: application/gzip | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Pack legacy testnet configs | |
run: cd dist2 && tar cfz testnet-all.tar.gz * | |
- name: Upload full config artifact | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist2/testnet-all.tar.gz | |
asset_name: testnet-all.tar.gz | |
asset_content_type: application/gzip | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload genesis.json artifact | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/metadata/genesis.json | |
asset_name: genesis.json | |
asset_content_type: application/json | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload config.yaml artifact | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/metadata/config.yaml | |
asset_name: config.yaml | |
asset_content_type: application/yaml | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload genesis.ssz artifact | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/metadata/genesis.ssz | |
asset_name: genesis.ssz | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
prepare_rollback: | |
name: Prepare master branch for next rollback | |
needs: build_release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update values.env for next round | |
run: bash ./scripts/prepare-rollback.sh | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Prepare values.env for next rollback | |
branch: master | |
push_options: '--force' | |
skip_checkout: true | |