Skip to content

Commit

Permalink
Update create_rel_tag.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaustubh-pande authored Mar 27, 2024
1 parent 64b9efa commit ede475c
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/create_rel_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ede475c

Please sign in to comment.