diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..65f5735 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Update major.minor tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_NAME=$(git describe --tags --abbrev=0) + MAJOR_MINOR=$(echo $TAG_NAME | grep -oE 'v[0-9]+\.[0-9]+') + git tag -f $MAJOR_MINOR $TAG_NAME + git push origin -f $MAJOR_MINOR \ No newline at end of file