1
0
Fork 0
forked from lthn/blockchain

Extract and use BUILD_VERSION for release tag

The workflow now extracts BUILD_VERSION from the Makefile and uses it as the release tag name instead of the chain network. This ensures that releases are tagged with the correct version, and adds error handling if the version is not found.
This commit is contained in:
Snider 2025-09-30 15:44:10 +01:00
parent 93463e043d
commit 737cbb7a8a

View file

@ -29,6 +29,14 @@ runs:
FILENAME="${{ inputs.chain-network }}-${{ inputs.asset-type }}-${TARGET_OS}-${LOWERCASE_ARCH}"
echo "key=$FILENAME" >> $GITHUB_OUTPUT
VERSION=$(grep '^BUILD_VERSION:=' Makefile | cut -d'=' -f2)
# Check if a version was found
if [ -z "$VERSION" ]; then
echo "Error: BUILD_VERSION could not be found in the Makefile." >&2
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
# Format the output to be a multi-line string.
# This is the correct way to pass a multi-line string in GITHUB_OUTPUT.
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@ -62,7 +70,7 @@ runs:
- name: Make Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.chain-network }}
tag_name: ${{ steps.asset.outputs.version }}
prerelease: contains(inputs.chain-network, 'testnet')
files: ${{ inputs.asset-directory }}/lethean-*
target_commitish: ${{ github.sha }}