Skip to content

Commit

Permalink
Merge pull request #155 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 [ed-11261]
  • Loading branch information
davseve authored Jul 24, 2023
2 parents c4c362d + 6c4e64f commit d28d5d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/env-vars-configure/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ 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`.
# If the channel is tagged as a prerelease, then get the latest prerelease version
# If the channel is tagged as a prerelease, than get the latest prerelease version
# If the channel is not tagged as a prerelease, than get the latest version which is not a prerelease or an rc
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}' | awk -F'${{ inputs.ADDITION_NAME }}' '{print $1}' || echo 0)
else
CURRENT_CHANNEL_VERSION=$(git ls-remote --tags | grep -v "\-rc" | grep -v "\-prerelease" | grep -v "refs/tags/v" | grep "${{ inputs.CHANNEL }}" | grep "${{ env.CLEAN_PACKAGE_VERSION }}" | tail -n1 | awk -F'${{ inputs.CHANNEL }}' '{print $2}' || echo 0)
fi
# DELETE!!!
echo "CURRENT_CHANNEL_VERSION_CHECK=$CURRENT_CHANNEL_VERSION"
# If value is not a number (e.g. empty string) then set it to 0
if ! [[ $CURRENT_CHANNEL_VERSION =~ ^[0-9]+$ ]]; then
CURRENT_CHANNEL_VERSION=0
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/one-click-hosting-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ jobs:
run: |
if [ ${{ github.event.inputs.pre_release }} == true ]; then
PRE_RELEASE="-prerelease"
echo "This is a prerelease execution"
else
PRE_RELEASE=""
echo "This is a release execution"
fi
echo "PRE_RELEASE=${PRE_RELEASE}" >> $GITHUB_ENV
- name: Env Vars Configure
Expand Down Expand Up @@ -87,6 +89,7 @@ jobs:
prerelease: ${{ github.event.inputs.pre_release }}
body_path: ${{ env.CHANGELOG_FILE }}
- name: Post To Slack Created Cloud one click Release
if: ${{ github.event.inputs.pre_release }} == false
uses : ./.github/workflows/post-to-slack
with:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}
Expand All @@ -98,7 +101,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Hi All :smile:\n\nWe just Published Could Continues release of *Elementor*\n`${{ env.PACKAGE_VERSION }}`"
"text": "Hi All :smile:\n\nWe just Published Could release of *Elementor*\n`${{ env.PACKAGE_VERSION }}`"
}
},
{
Expand Down

0 comments on commit d28d5d1

Please sign in to comment.