Add a workflow to automatically update main tag #1
Workflow file for this run
This file contains 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: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: version | |
id: version | |
run: | | |
tag=${GITHUB_REF/refs\/tags\//} | |
version=${tag#v} | |
major=${version%%.*} | |
echo "tag=${tag}" >> $GITHUB_OUTPUT | |
echo "version=${version}" >> $GITHUB_OUTPUT | |
echo "major=${major}" >> $GITHUB_OUTPUT | |
- name: force update major tag | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f | |
git push origin refs/tags/v${{ steps.version.outputs.major }} -f |