From 77ffe581f9f7ae505a1bab4a000822ba052a8abf Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 2 Dec 2024 18:24:26 +0100 Subject: [PATCH] Add action to bump version --- .github/workflows/bump.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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 000000000..5da2d0491 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,29 @@ +name: Bump NPM version and push git tag + +on: + workflow_dispatch: + inputs: + version: + description: "Version to set (e.g., 1.2.3)" + required: true + +jobs: + bump: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + id: setup-node + with: + node-version-file: ".nvmrc" + + - run: | + npm version ${{ inputs.version }} --no-git-tag-version + git add package.json package-lock.json + git commit -m "Bump version to ${{ inputs.version }}" + git tag "v${{ inputs.version }}" + git push --follow-tags + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}