-
Notifications
You must be signed in to change notification settings - Fork 22
60 lines (52 loc) · 1.75 KB
/
update-version.yml
File metadata and controls
60 lines (52 loc) · 1.75 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
name: Update Version
on:
workflow_dispatch:
inputs:
version:
description: 'New version (e.g. 25.12)'
required: true
type: string
create_pr:
description: 'Create a pull request with the changes'
required: true
type: boolean
default: true
run-name: "Update version to ${{ inputs.version }}"
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update versions
run: ./scripts/update-version.sh ${{ inputs.version }}
- name: Verify versions
run: ./scripts/update-version.sh
- name: Show changed files
run: git diff --name-only
- name: Create pull request
if: ${{ inputs.create_pr }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ inputs.version }}
run: |
BRANCH="update-version-${VERSION}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "${BRANCH}"
git add -A
git commit -m "Update version to ${VERSION}"
git push -u origin "${BRANCH}"
gh pr create \
--title "Update version to ${VERSION}" \
--body "Automated version update to **${VERSION}** across all projects, Dockerfiles, and README."
- name: Commit directly
if: ${{ !inputs.create_pr }}
env:
VERSION: ${{ inputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Update version to ${VERSION}"
git push