From 683c6f7326381fd6942bf2456f025bec43b5e8fa Mon Sep 17 00:00:00 2001 From: exoego Date: Sat, 11 May 2024 16:15:03 +0900 Subject: [PATCH] Bump major version automatically --- .github/workflows/bump.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/bump.yml diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..8793e8e --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,27 @@ +name: Bump major version +on: + push: + tags: + - 'v*.*.*' + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + token: ${{ secrets.ACTIONS_BOT_TOKEN }} + fetch-depth: 0 + - name: Git config + run: | + git config user.name actions-bot + git config user.email actions-bot@users.noreply.github.com + - name: Tag new target + run: | + major_version=$(echo "${{ github.ref_name }}" | cut -d'.' -f1) + git tag -f $major_version ${{ github.ref_name }} + - name: Push new tag + run: | + major_version=$(echo "${{ github.ref_name }}" | cut -d'.' -f1) + git push origin $major_version --force