tag-public-pricing.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. name: Tag public pricing module
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. paths:
  7. - 'modules/pricing/public/**'
  8. concurrency:
  9. group: tag-public-pricing
  10. cancel-in-progress: false
  11. jobs:
  12. tag:
  13. name: Auto-increment and push tag
  14. runs-on: ubuntu-latest
  15. permissions:
  16. contents: write
  17. steps:
  18. - uses: actions/checkout@v4
  19. with:
  20. fetch-depth: 0
  21. - name: Compute next patch version
  22. id: version
  23. run: |
  24. # Find the latest tag matching modules/pricing/public/vX.Y.Z
  25. LATEST=$(git tag --list 'modules/pricing/public/v*' \
  26. | sort -V | tail -n1)
  27. if [ -z "$LATEST" ]; then
  28. # No tag exists yet — start at v1.0.0
  29. NEXT="modules/pricing/public/v1.0.0"
  30. else
  31. # Strip the prefix, split semver, bump patch
  32. VERSION="${LATEST#modules/pricing/public/v}"
  33. MAJOR=$(echo "$VERSION" | cut -d. -f1)
  34. MINOR=$(echo "$VERSION" | cut -d. -f2)
  35. PATCH=$(echo "$VERSION" | cut -d. -f3)
  36. NEXT="modules/pricing/public/v${MAJOR}.${MINOR}.$((PATCH + 1))"
  37. fi
  38. echo "tag=$NEXT" >> "$GITHUB_OUTPUT"
  39. echo "Next tag: $NEXT"
  40. - name: Push tag
  41. run: |
  42. git config user.name "github-actions[bot]"
  43. git config user.email "github-actions[bot]@users.noreply.github.com"
  44. git tag "${{ steps.version.outputs.tag }}"
  45. git push origin "${{ steps.version.outputs.tag }}"