diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9712724..7e50dd3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,8 @@ jobs: - name: Check Solana version run: | - echo "CI_TAG=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV" + echo "CI_TAG=$(ci/getTag.sh)" >> "$GITHUB_ENV" + echo "BUILD_NAME=$GEYSER_PLUGIN_NAME-$CI_TAG-$SOLANA_VERSION" >> "$GITHUB_ENV" echo "CI_OS_NAME=linux" >> "$GITHUB_ENV" SOLANA_VERSION="$(./ci/solana-version.sh)" @@ -49,6 +50,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: + tag_name: ${{ env.BUILD_NAME }} body: | ${{ env.GEYSER_PLUGIN_NAME }} ${{ env.CI_TAG }} solana ${{ env.SOLANA_VERSION }} diff --git a/ci/getTag.sh b/ci/getTag.sh new file mode 100755 index 0000000..11f168e --- /dev/null +++ b/ci/getTag.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Set var and validate return value is not empty +CI_TAG=$(git show-ref --tags | grep $(git rev-parse HEAD) | awk -F/ '{print $3}') +# count amount of characters in the variable +validate=${#CI_TAG} +if [[ $validate -lt 1 ]] +then + CI_TAG=$(git tag --points-at HEAD) + validate=${#CI_TAG} + if [[ $CI_TAG -lt 1 ]] + then + CI_TAG=$(git rev-parse --short HEAD) + fi +fi + +# Printing value for return +echo $CI_TAG diff --git a/ci/solana-version.sh b/ci/solana-version.sh index 5b98da7..104c080 100755 --- a/ci/solana-version.sh +++ b/ci/solana-version.sh @@ -4,6 +4,4 @@ set -e -cd "$(dirname "$0")/.." - -grep solana-geyser-plugin-interface crates/plugin/Cargo.toml | cut -d ' ' -f3 | sed 's/\"/ /g;s/=//;s/ //' +grep solana-program Cargo.lock | head -n1 | awk '{print $2}'