Skip to content

Commit

Permalink
fix: use RELEASE_VERSION for BUILD_SOURCEVERSION (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Oct 16, 2022
1 parent fc8e62c commit e14a115
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/insider-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Get version
env:
RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> $GITHUB_ENV
run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> "${GITHUB_ENV}"

- name: Publish vscodium-insiders-bin
uses: zokugun/github-actions-aur-releaser@v1
Expand Down
2 changes: 1 addition & 1 deletion get_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ git checkout FETCH_HEAD
cd ..

# for GH actions
if [[ ${GITHUB_ENV} ]]; then
if [[ "${GITHUB_ENV}" ]]; then
echo "MS_TAG=${MS_TAG}" >> "${GITHUB_ENV}"
echo "MS_COMMIT=${MS_COMMIT}" >> "${GITHUB_ENV}"
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_ENV}"
Expand Down
14 changes: 4 additions & 10 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@

if [[ -z "${BUILD_SOURCEVERSION}" ]]; then

APP_HASH=$( git rev-parse HEAD )

cd vscode
VSCODE_HASH=$( git rev-parse HEAD )
cd ..

if type -t "sha1sum" > /dev/null 2>&1; then
export BUILD_SOURCEVERSION=$( echo "${APP_HASH}:${VSCODE_HASH}" | sha1sum | cut -d' ' -f1 )
export BUILD_SOURCEVERSION=$( echo "${RELEASE_VERSION}" | sha1sum | cut -d' ' -f1 )
else
npm install -g checksum

export BUILD_SOURCEVERSION=$( echo "${APP_HASH}:${VSCODE_HASH}" | checksum )
export BUILD_SOURCEVERSION=$( echo "${RELEASE_VERSION}" | checksum )
fi

echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""

# for GH actions
if [[ $GITHUB_ENV ]]; then
echo "BUILD_SOURCEVERSION=$BUILD_SOURCEVERSION" >> $GITHUB_ENV
if [[ "${GITHUB_ENV}" ]]; then
echo "BUILD_SOURCEVERSION=${BUILD_SOURCEVERSION}" >> "${GITHUB_ENV}"
fi
fi

0 comments on commit e14a115

Please sign in to comment.