check-version-and-push-tag.yml 841 B

1234567891011121314151617181920212223242526272829303132333435
  1. name: check version and push tag
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches:
  6. - main
  7. jobs:
  8. check:
  9. runs-on: ubuntu-latest
  10. permissions: write-all
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v4
  14. - name: Check version
  15. id: version-check
  16. run: |
  17. chmod +x ./scripts/is-newer-version.bash
  18. chmod +x ./scripts/get-version.bash
  19. VERSION=$(./scripts/is-newer-version.bash)
  20. echo "version=${VERSION}" >> $GITHUB_OUTPUT
  21. if [ "$VERSION" != "0" ]; then
  22. echo "New version detected: $VERSION"
  23. else
  24. echo "No new version to release"
  25. fi
  26. - name: Push tag
  27. if: steps.version-check.outputs.version != '0'
  28. uses: actions-ecosystem/action-push-tag@v1
  29. with:
  30. tag: "v${{ steps.version-check.outputs.version }}"