From ede475c6fea740db95936527bef52a2d37f2f3a9 Mon Sep 17 00:00:00 2001 From: Kaustubh Pande Date: Wed, 27 Mar 2024 19:48:59 +0530 Subject: [PATCH] Update create_rel_tag.yml --- .github/workflows/create_rel_tag.yml | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/create_rel_tag.yml b/.github/workflows/create_rel_tag.yml index 3d25522..3adb329 100644 --- a/.github/workflows/create_rel_tag.yml +++ b/.github/workflows/create_rel_tag.yml @@ -19,21 +19,29 @@ jobs: old_tag: ${{ steps.get_tag.outputs.old_tag_name }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get latest tag id: get_tag run: echo "old_tag_name=$(git ls-remote --tags origin | awk -F"/" '{print $3}' | grep -v '{}' | sort -V | tail -n1)" >> $GITHUB_OUTPUT - + - name: Compare tags + id: compare_tags + run: | + latest_tag=${{ steps.fetch-tag.outputs.old_tag }} + new_tag=${{ github.event.inputs.tag_name }} + echo "Latest Tag: $latest_tag" + echo "New Tag: $new_tag" + node -e "const [latestMajor, latestMinor, latestPatch] = process.env.LATEST_TAG.substring(1).split('.'); const [newMajor, newMinor, newPatch] = process.env.NEW_TAG.substring(1).split('.'); if (latestMajor > newMajor || (latestMajor == newMajor && latestMinor > newMinor) || (latestMajor == newMajor && latestMinor == newMinor && latestPatch >= newPatch)) { console.log('Error: New tag is not greater than the latest tag.'); process.exit(1); }" + update-params-env: runs-on: ubuntu-latest needs: fetch-tag outputs: param_env: ${{ steps.read_params_env.outputs.params_env }} - release_version: ${{ steps.get_release_version.outputs.release_version }} + # release_version: ${{ steps.get_release_version.outputs.release_version }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Read params.env id: read_params_env @@ -66,18 +74,9 @@ jobs: old_tag: ${{ needs.fetch-tag.outputs.old_tag }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: changelog print old tag run: echo "old_tag is $old_tag" - - name: Compare tags - id: compare_tags - run: | - latest_tag=$old_tag - new_tag=${{ github.event.inputs.tag_name }} - echo "Latest Tag: $latest_tag" - echo "New Tag: $new_tag" - node -e "const [latestMajor, latestMinor, latestPatch] = process.env.LATEST_TAG.substring(1).split('.'); const [newMajor, newMinor, newPatch] = process.env.NEW_TAG.substring(1).split('.'); if (latestMajor > newMajor || (latestMajor == newMajor && latestMinor > newMinor) || (latestMajor == newMajor && latestMinor == newMinor && latestPatch >= newPatch)) { console.log('Error: New tag is not greater than the latest tag.'); process.exit(1); }" - - name: Build Changelog id: build_changelog uses: mikepenz/release-changelog-builder-action@v4 @@ -100,7 +99,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Generate Release Notes run: echo ${{ env.changelog }} - name: Create Release