Release node #47
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: Release node | |
on: | |
workflow_dispatch: | |
inputs: | |
network: | |
description: "Network" | |
required: true | |
type: choice | |
options: | |
- darwinia | |
- crab | |
- pangolin | |
tag: | |
description: "Release tag" | |
type: string | |
env: | |
ARTIFACT_LINK_PREFIX: https://github.com/darwinia-network/darwinia/releases/download | |
jobs: | |
release-node: | |
name: Release ${{ github.event.inputs.network }} node | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare artifacts | |
run: | | |
mkdir artifacts | |
curl -fLO ${{ env.ARTIFACT_LINK_PREFIX }}/${{ github.event.inputs.tag }}/darwinia-x86_64-linux-gnu.tar.bz2 | |
curl -fLO ${{ env.ARTIFACT_LINK_PREFIX }}/${{ github.event.inputs.tag }}/darwinia-x86_64-linux-gnu.tar.zst | |
mv darwinia-x86_64-linux-gnu.tar.* artifacts/ | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
artifacts/* | |
prerelease: ${{ startsWith(github.event.inputs.tag, 'pango') }} | |
tag_name: ${{ github.event.inputs.network }}-${{ github.event.inputs.tag }} | |
target_commitish: ${{ github.event.inputs.network }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-node: | |
name: Deploy ${{ github.event.inputs.network }} node | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy tracing nodes | |
run: | | |
GITHUB_TOKEN=${{ secrets.GH_TKN_DARWINIA }} gh workflow run \ | |
trigger-tracing-node.yml \ | |
--ref=main \ | |
--repo=darwinia-network/devops \ | |
--raw-field=network=${{ github.event.inputs.network }} \ | |
--raw-field="version=${{ github.event.inputs.tag }}" | |
- name: Deploy pangolin nodes | |
if: ${{ github.event.inputs.network == 'pangolin' }} | |
run: | | |
MESSAGE='${{ github.event.head_commit.message }}' | |
DOCKER_IMAGE_TAG=ghcr.io/darwinia-network/darwinia:${{ github.event.inputs.tag }} | |
jq -n \ | |
--arg file playbooks/pangolin_nodes/host_vars/g1.testnets \ | |
--arg key .substrate_node_runner.node.image \ | |
--arg value ${DOCKER_IMAGE_TAG} \ | |
'{file: $file, key: $key, value: $value}' >> /tmp/changes.json | |
jq -n \ | |
--arg file playbooks/pangolin_nodes/host_vars/g2.testnets \ | |
--arg key .substrate_node_runner.node.image \ | |
--arg value ${DOCKER_IMAGE_TAG} \ | |
'{file: $file, key: $key, value: $value}' >> /tmp/changes.json | |
MULTI_CHANGES=$(jq -crs '.' < /tmp/changes.json) | |
GITHUB_TOKEN=${{ secrets.GH_TKN_DARWINIA }} gh workflow run \ | |
trigger.yml \ | |
--ref=main \ | |
--repo=darwinia-network/ansible-playbooks \ | |
--raw-field="changes=${MULTI_CHANGES}" \ | |
--raw-field="message=[darwinia-release]: [deploy-${{ github.event.inputs.network }}] ${MESSAGE}" |