From: W. Felix Handte Date: Mon, 15 Mar 2021 15:59:31 +0000 (-0400) Subject: Maintain Artifact Name Backwards Compatibility X-Git-Tag: v1.4.10~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eed64d75f4bfc4f625f6b2df3087e03a2fb73bb2;p=thirdparty%2Fzstd.git Maintain Artifact Name Backwards Compatibility When the tag is `v1.2.3`, name the artifacts `zstd-1.2.3.tar*` rather than `zstd-v1.2.3.tar*`. When the tag doesn't match, use the full tag. --- diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index 8fd23fb94..04a093c4b 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -19,12 +19,15 @@ jobs: RELEASE_SIGNING_KEY: ${{ secrets.RELEASE_SIGNING_KEY }} run: | # compute file name - export TAG=$(echo $GITHUB_REF | sed -n 's_^refs/tags/__p') + export TAG="$(echo "$GITHUB_REF" | sed -n 's_^refs/tags/__p')" if [ -z "$TAG" ]; then echo "action must be run on a tag. GITHUB_REF is not a tag: $GITHUB_REF" exit 1 fi - export ZSTD_VERSION=zstd-$TAG + # Attempt to extract "1.2.3" from "v1.2.3" to maintain artifact name backwards compat. + # Otherwise, degrade to using full tag. + export VERSION="$(echo "$TAG" | sed 's_^v\([0-9]\+\.[0-9]\+\.[0-9]\+\)$_\1_')" + export ZSTD_VERSION="zstd-$VERSION" # archive git archive $TAG \ @@ -41,6 +44,7 @@ jobs: zstd -k -19 $ZSTD_VERSION.tar gzip -k -9 $ZSTD_VERSION.tar + # we only publish the compressed tarballs rm $ZSTD_VERSION.tar # hash