fix: fix go.mod #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Tag | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Get latest tag | |
| id: get_tag | |
| run: | | |
| echo "::set-output name=tag::$(git describe --tags --abbrev=0 2>/dev/null || echo v0.0.0)" | |
| - name: Bump patch version and create tag | |
| id: bump_tag | |
| run: | | |
| last_tag=${{ steps.get_tag.outputs.tag }} | |
| IFS='.' read -r major minor patch <<<"${last_tag//v/}" | |
| patch=$((patch + 1)) | |
| new_tag="v${major}.${minor}.${patch}" | |
| echo "New tag: $new_tag" | |
| git tag $new_tag | |
| git push origin $new_tag |