-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (68 loc) · 2.52 KB
/
version-bump.yml
File metadata and controls
77 lines (68 loc) · 2.52 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
name: Bump the version
on:
workflow_dispatch:
inputs:
bumpLevel:
description: "Kind of version bump for project"
required: true
default: "patch"
type: choice
options:
- major
- minor
- patch
- client
bumpClient:
description: "Bump supported client?"
required: true
type: boolean
newClientVersion:
description: "Version of new client (needed to bump supported client)"
required: true
default: "0.0.0"
type: string
permissions:
contents: read
jobs:
bumpversion:
name: Bump the package version
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install package
run: |
set -eux
pip install --disable-pip-version-check -e "."[cicd,server,developer]
- name: Run bumpversion and push tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "DiamondLightSource-build-server"
git config --global user.email "DiamondLightSource-build-server@users.noreply.github.com"
git config credential.helper "store --file=.git/credentials"
echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials
echo "##[section]Creating commit on branch 'version-bump'"
git checkout -b version-bump
if [[ ${{ inputs.bumpClient }} == true && ${{ inputs.newClientVersion }} != "0.0.0" ]]; then
bump-my-version bump --config-file .bumpclient.toml --new-version ${{ inputs.newClientVersion }}
fi
if [ ${{ inputs.bumpLevel }} != "client" ]; then
bump-my-version bump ${{ inputs.bumpLevel }}
fi
echo "##[section]Creating pull request"
git push -f --set-upstream origin version-bump
gh pr create -B main -H version-bump -t "Version update (${{ inputs.bumpLevel }})" -b "
This is an automated pull request to update the version.
Bumped supported client client version: ${{ inputs.bumpClient }}
If true, the supported client version is now: ${{ inputs.newClientVersion }}
After merging this, the \`Publish version\` action will tag this release and publish to pypi.
"
echo