Release #9
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: Release | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: main | |
| - name: Compute next minor tag | |
| id: next | |
| run: | | |
| if existing=$(git describe --tags --exact-match HEAD 2>/dev/null); then | |
| echo "::error::HEAD is already released as ${existing}; refusing to tag an already-tagged commit" | |
| exit 1 | |
| fi | |
| latest=$(git describe --tags --abbrev=0) | |
| ver=${latest#v} | |
| IFS=. read -r major minor _ <<< "$ver" | |
| new="v${major}.$((minor + 1)).0" | |
| echo "tag=$new" >> "$GITHUB_OUTPUT" | |
| - name: Tag and push | |
| run: | | |
| git tag "${{ steps.next.outputs.tag }}" | |
| git push origin "${{ steps.next.outputs.tag }}" |