Skip to content

Commit

Permalink
chore: Remove version and sha from releases binaries filenames (#2769)
Browse files Browse the repository at this point in the history
* chore: Add SHA to chectl version

Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Sep 27, 2023
1 parent a047295 commit b93dc03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/release-build-and-push-to-GH-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ jobs:
- name: Generate tag utilities
id: TAG_UTIL
run: |
SHORT_SHA1=$(git rev-parse --short HEAD)
echo "short_sha1=$SHORT_SHA1" >> $GITHUB_OUTPUT
if [[ ${GITHUB_REF#refs/heads/} =~ 7.* ]]; then
echo "chectl_version=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "gh_release_name=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "gh_tag=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "MM_ANNOUNCE=true" >> "$GITHUB_ENV"
elif [[ ${GITHUB_REF#refs/heads/} =~ main ]]; then
CURRENT_DAY=$(date +'%Y%m%d')
SHORT_SHA1=$(git rev-parse --short HEAD)
echo "gh_tag=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
echo "chectl_version=0.0.$CURRENT_DAY-next" >> $GITHUB_OUTPUT
echo "chectl_version=0.0.$CURRENT_DAY-next.$SHORT_SHA1" >> $GITHUB_OUTPUT
echo "gh_release_name=0.0.$CURRENT_DAY-next.$SHORT_SHA1" >> $GITHUB_OUTPUT
echo "MM_ANNOUNCE=false" >> "$GITHUB_ENV"
fi
Expand All @@ -60,6 +62,11 @@ jobs:
TARGETS=linux-arm,linux-x64,linux-s390x,linux-ppc64le,darwin-x64,darwin-arm64,win32-x64,win32-x86
yarn prepack && yarn pack-binaries --targets=$TARGETS
# Rename binaries to remove the sha1 from their names
for file in ./dist/*; do
mv "$file" "${file/-v${{ steps.TAG_UTIL.outputs.chectl_version }}-${{ steps.TAG_UTIL.outputs.short_sha1 }}/}"
done
- name: Create Release and push artifacts
uses: softprops/action-gh-release@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3276,7 +3276,7 @@ detect-newline@^3.0.0:

"devworkspace-operator@https://github.com/devfile/devworkspace-operator#main":
version "0.0.0"
resolved "https://github.com/devfile/devworkspace-operator#58ada48c0ec852fd5670868edb4702d0e4ed81e3"
resolved "https://github.com/devfile/devworkspace-operator#9450aa8894047f242cb0b40ce8e0e60df13ea27c"

dezalgo@^1.0.0:
version "1.0.4"
Expand Down Expand Up @@ -3337,7 +3337,7 @@ ecc-jsbn@~0.1.1:

"eclipse-che-operator@https://github.com/eclipse-che/che-operator#main":
version "0.0.0"
resolved "https://github.com/eclipse-che/che-operator#5d702069dde221cfcfffeddca5b9f6119e76c15d"
resolved "https://github.com/eclipse-che/che-operator#5f0843ab268a69a0c3ad6e95f56d0d700e47e90f"

editorconfig@^0.15.0:
version "0.15.3"
Expand Down Expand Up @@ -3826,7 +3826,7 @@ extsprintf@^1.2.0:
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=

fancy-test@^2.0.12, fancy-test@^2.0.25:
fancy-test@^2.0.25:
version "2.0.25"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-2.0.25.tgz#9a0578a4820460cb2c1250dfb48d4664ca59c83a"
integrity sha512-4OKW+SC62aP3Y19YlCWxjKJD0iW4kjLqUvdd9OaW1lM7Co/FX3PTi2NHguzsj2vmPs/6mMITKu0saYAr2uZA4g==
Expand Down

0 comments on commit b93dc03

Please sign in to comment.