Move main version to v1.2.1 #4
Workflow file for this run
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: Update main version | |
| run-name: Move main version to ${{ github.ref_name }} | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| tag: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Configure Git | |
| run: | | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git config user.name 'github-actions[bot]' | |
| - name: Set main version | |
| id: set-main-version | |
| run: | | |
| main_version="$(echo "${GITHUB_REF_NAME}" | grep -oP "^(v\d+)")" | |
| echo "main-version=${main_version}" >> "${GITHUB_OUTPUT}" | |
| - name: Tag new target | |
| run: git tag --force "${MAIN_VERSION}" "${GITHUB_REF_NAME}" | |
| env: | |
| MAIN_VERSION: ${{ steps.set-main-version.outputs.main-version }} | |
| - name: Push new tag | |
| run: git push --force origin "${MAIN_VERSION}" | |
| env: | |
| MAIN_VERSION: ${{ steps.set-main-version.outputs.main-version }} |