Skip to content

Commit

Permalink
Merge pull request #146 from davseve/internal/ED-11261-one-click-clou…
Browse files Browse the repository at this point in the history
…d-release

pre release condition step added in get-previous-release [ed-11261]
  • Loading branch information
davseve authored Jul 24, 2023
2 parents 2730a3b + 58b6611 commit 61a4ae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/env-vars-configure/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ runs:
run: |
# This command retrieves the latest tag that matches the specified channel and package version,
# and extracts the version number from the tag name using awk. E.g. retrieves the number 7 from `3.11.0-cloud7`.
CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0)
# If the channel is prerelease, then get the latest prerelease version
if [[ "${{ inputs.ADDITION_NAME }}" == "-prerelease" ]]; then
CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep "\-prerelease" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0)
else
CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0)
fi
# If value is not a number (e.g. empty string) then set it to 0
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/get-previous-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ runs:
run: |
# If the channel is either "cloud" or "beta", fetch all Git tags matching the channel pattern,
# excluding any "-rc" tags, and store them in the 'tags' variable. e.g. "refs/tags/v3.11.0-cloud1 , refs/tags/v3.11.0-cloud2"
if [[ ${{ inputs.CHANNEL }} == "cloud" || ${{ inputs.CHANNEL }} == "beta" ]]; then
if [[ ${{ inputs.CHANNEL }} == "cloud" || ${{ inputs.CHANNEL }} == "beta" && ${{ env.ADDITION_NAME }} == "-prerelease" ]]; then
tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep -v "\-rc" | awk '{print $2}')
fi
if [[ ${{ inputs.CHANNEL }} == "cloud" && ${{ env.ADDITION_NAME }} == "-prerelease" ]]; then
tags=$(git ls-remote --tags | grep ${{ inputs.CHANNEL }} | grep "\-prerelease" | awk '{print $2}')
fi
# If the channel is "ga", fetch all Git tags matching the semantic versioning pattern "vX.Y.Z"
# and store them in the 'tags' variable. e.g. "refs/tags/v3.11.1 , refs/tags/v3.11.2"
if [[ ${{ inputs.CHANNEL }} == "ga" ]]; then
Expand Down

0 comments on commit 61a4ae9

Please sign in to comment.