diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 711c9a2..4ac6134 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -72,7 +72,16 @@ jobs: - name: Set the release version shell: bash - run: echo "RELEASE_VERSION=${github.event.inputs.release_version || GITHUB_REF:11}" >> $GITHUB_ENV + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "push" ]]; then + VERSION=$(echo "${GITHUB_REF}" | sed -E 's|refs/heads/release/v||') + echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "release" ]]; then + VERSION=$(echo "${GITHUB_REF}" | sed -E 's|refs/tags/v||') + echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + fi - name: Install Rust toolchain uses: actions-rs/toolchain@v1