diff --git a/.github/workflows/evo-tool-download-update.yml b/.github/workflows/evo-tool-download-update.yml new file mode 100644 index 000000000..59290a351 --- /dev/null +++ b/.github/workflows/evo-tool-download-update.yml @@ -0,0 +1,27 @@ +name: Update Dash Evo Tool download links + +on: + repository_dispatch: + types: [release_published] + workflow_dispatch: # This allows the workflow to be triggered manually + schedule: # Run daily at midnight UTC + - cron: 0 0 * * * + +jobs: + update-evo-tool-download-links: + runs-on: ubuntu-latest + + steps: + - name: Checkout this repository + uses: actions/checkout@v4 + + - name: Run evo tool download link update script + run: "${GITHUB_WORKSPACE}/scripts/evo-tool-download-link-update.sh" + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + branch: update-docs/${{ github.sha }} + title: "chore: update evo tool download links to latest version" + body: | + This PR updates download links in the documentation to use the latest Dash Evo Tool version. diff --git a/docs/user/network/dash-evo-tool/index.rst b/docs/user/network/dash-evo-tool/index.rst index 0bbc5ba0b..e37d99935 100644 --- a/docs/user/network/dash-evo-tool/index.rst +++ b/docs/user/network/dash-evo-tool/index.rst @@ -25,11 +25,11 @@ Linux, MacOS, or Windows packages are available on the `GitHub releases page `__. Download the zip file for your Operating System, then unzip the downloaded file: -* `Windows `_ -* `Mac (ARM m1-m4) `_ -* `Mac (x86) `_ -* `Linux (x86) `_ -* `Linux (ARM) `_ +* `Windows `_ +* `Mac (ARM m1-m4) `_ +* `Mac (x86) `_ +* `Linux (x86) `_ +* `Linux (ARM) `_ .. _evo-tool-configure: diff --git a/scripts/evo-tool-download-link-update.sh b/scripts/evo-tool-download-link-update.sh new file mode 100755 index 000000000..e6653dff4 --- /dev/null +++ b/scripts/evo-tool-download-link-update.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Script to update the download/install related version references when a new +# Dash Evo Tool version is released + +# Command to get latest Dash Evo Tool tag name +NEW_VERSION=$(curl -s \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/dashpay/dash-evo-tool/releases/latest | \ + jq -r '.tag_name' | sed 's/^v//') + +if [[ $? -ne 0 || -z "$NEW_VERSION" ]]; then + echo "Error: Unexpected response when retrieving the current version. Received: $NEW_VERSION" +else + # Print the extracted values (for verification) + echo "Extracted Version: $NEW_VERSION" + # git checkout -b v$NEW_VERSION-links # Uncomment to use locally + + # Use the variables in the find/sed commands + find . -iname "*.rst" -exec sed -i "s~https://github\.com/dashpay/dash-evo-tool/releases/download/v[0-9]\+\.[0-9]\+\.[0-9]\+~https://github.com/dashpay/dash-evo-tool/releases/download/v${NEW_VERSION}~g" {} + + + echo "Dash Evo Tool version updated to ${NEW_VERSION} in documentation" +fi