From 87d3f8d88d718a7c48e7e9109b2c46360ec5da46 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Mon, 16 Sep 2024 23:26:50 -0700 Subject: [PATCH] add bump version workflow --- .github/workflows/bump-version.yml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/bump-version.yml diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml new file mode 100644 index 000000000..40e2dac85 --- /dev/null +++ b/.github/workflows/bump-version.yml @@ -0,0 +1,59 @@ +# Workflow to manage bumping the package version and pushing it to the target branch. + +name: Bump version +on: + workflow_dispatch: + inputs: + bump: + description: SemVer Bump + required: true + default: beta + type: choice + options: + - beta + - patch + - minor + - major +env: + NODE_VERSION: "22.5.1" +jobs: + bump-version: + runs-on: ubuntu-latest + steps: + - name: Get App Token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.WAVE_BUILDER_APPID }} + private-key: ${{ secrets.WAVE_BUILDER_KEY }} + - uses: actions/checkout@v4 + with: + token: ${{ steps.app-token.outputs.token }} + + # General build dependencies + - uses: actions/setup-node@v4 + with: + node-version: ${{env.NODE_VERSION}} + - name: Install Yarn + run: | + corepack enable + yarn install + - name: Install Task + uses: arduino/setup-task@v2 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: "Set Version: ${{ inputs.bump }}" + id: set-version + run: echo "WAVETERM_VERSION=$(task version:${{ inputs.bump }})" >> "$GITHUB_OUTPUT" + shell: bash + + - name: "Push version bump: ${{ steps.set-version.outputs.WAVETERM_VERSION }}" + run: | + git config user.name wave-builder + git config user.email builds@commandline.dev + git add package.json + git commit -m "Bump version to ${{ steps.set-version.outputs.WAVETERM_VERSION }}" + git tag -a ${{ steps.set-version.outputs.WAVETERM_VERSION }} -m "Bump version to ${{ steps.set-version.outputs.WAVETERM_VERSION }}" + git push