-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (84 loc) · 2.38 KB
/
manual-update-version.yml
File metadata and controls
92 lines (84 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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