From cd43501a41a22a841d1b34e176d5ae5fcdfb5983 Mon Sep 17 00:00:00 2001 From: Aizuu <64743287+iseizuu@users.noreply.github.com> Date: Sun, 25 Aug 2024 14:03:31 +0700 Subject: [PATCH] feat: add auto version bump --- .github/workflows/version-bump.yml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/version-bump.yml diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml new file mode 100644 index 0000000..4258f32 --- /dev/null +++ b/.github/workflows/version-bump.yml @@ -0,0 +1,47 @@ +name: Version Bump and Release + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + bump-version: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install dependencies + run: npm install + + - name: Bump version and push + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + npm version patch -m "Bump version to %s [skip ci]" + git push --follow-tags + + - name: Create a pull request for the new version + uses: peter-evans/create-pull-request@v5 + with: + branch: bump-version + commit-message: "Bump version to ${{ steps.bump.outputs.new-version }}" + title: "Bump version to ${{ steps.bump.outputs.new-version }}" + body: "This PR bumps the package version to ${{ steps.bump.outputs.new-version }}." + labels: version-bump + + notify-users: + needs: bump-version + runs-on: ubuntu-latest + steps: + - name: Send notification to users + run: | + echo "Sending notification to users about the new version..." + # You can customize this step to send notifications through email, Slack, or other channels.