Skip to content

(Manual) Update Version #5

(Manual) Update Version

(Manual) Update Version #5

name: (Manual) Update Version
on:
workflow_dispatch:
inputs:
type:
description: Bump type
required: true
default: patch
type: choice
options:
- patch
- minor
- major
- set
version:
description: Explicit version when type="set" (e.g., v1.2.3)
required: false
default: ''
permissions:
contents: write
pull-requests: write
jobs:
update:
name: Update version and push release branch
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Install Task
uses: arduino/setup-task@v2.0.0
with:
version: 3.x
- name: Update version
id: version
env:
BUMP_TYPE: ${{ github.event.inputs.type }}
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
set -eux
case "${BUMP_TYPE}" in
set)
if [ -z "${INPUT_VERSION}" ]; then
echo "Missing version for type=set"
exit 1
fi
task version:set VERSION_OVERRIDE="${INPUT_VERSION}"
;;
patch)
task version:update:patch
;;
minor)
task version:update:minor
;;
major)
task version:update:major
;;
*)
echo "Unknown type: ${BUMP_TYPE}"
exit 1
;;
esac
echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT"
- name: Get template
env:
VERSION_SUFFIX: ""
run: |
task git:set-config
task git:get-pr-template
- name: Push to release branch
uses: devops-infra/action-commit-push@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: ":rocket: Bump version to ${{ steps.version.outputs.REL_VERSION }}"
target_branch: ${{ format('release/{0}', steps.version.outputs.REL_VERSION) }}
- name: Create Pull Request
uses: devops-infra/action-pull-request@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true