.github/workflows: update to use env file instead of set-env
Set-env is deprecated.
Needs to be cherry-picked to the release branch too.
Updates golang/vscode-go#962
Change-Id: Ic27238ce3f982abad3e4b6a14f7c2fb7eb75341f
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/272828
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c984375..0e98de8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -50,17 +50,21 @@
exit 1
fi
- echo ::set-env name=EXT_VERSION::"${TAGGED_VERSION}"
+ echo "EXT_VERSION=${TAGGED_VERSION}" >> $GITHUB_ENV
WRITTEN_VERSION="$(cat package.json | jq '.version' -r)"
- if [[ ${TAGGED_VERSION} == *"-"* ]]; then
- echo ::set-env name=EXT_ISPREVIEW::1
+ if [[ "${TAGGED_VERSION}" == *"-"* ]]; then
+ if [[ ! "${TAGGED_VERSION}" == "${WRITTEN_VERSION}"-rc.* ]]; then
+ echo "Prerelease Tag and Version in package.json are not compatible: '${TAGGED_VERSION}' vs '${WRITTEN_VERSION}'"
+ exit 1
+ fi
+ echo "EXT_ISPREVIEW=1" >> $GITHUB_ENV
else
if [[ "${TAGGED_VERSION}" != "${WRITTEN_VERSION}" ]]; then
echo "Release Tag and Version in package.json do not match: '${TAGGED_VERSION}' vs '${WRITTEN_VERSION}'"
exit 1
fi
- echo ::set-env name=EXT_ISPREVIEW::0
+ echo "EXT_ISPREVIEW=0" >> $GITHUB_ENV
fi
- name: stamp version