-
Notifications
You must be signed in to change notification settings - Fork 20
69 lines (58 loc) · 1.94 KB
/
manual_release_trigger.yaml
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
name: Prepare release manually
on:
workflow_dispatch:
inputs:
release:
description: 'Type of release'
required: true
type: choice
options:
- 'MAJOR'
- 'MINOR'
- 'PATCH'
default: 'PATCH'
jobs:
bump-versions:
name: Bump versions and tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
.github
ci
src
pyproject.toml
requirements.txt
- name: Determine new versions
run: |
echo "release_version=$(./ci/version_determiner.py release-version $release_type)" >> "$GITHUB_ENV"
echo "version_tag=$(./ci/version_determiner.py version-tag $release_type)" >> "$GITHUB_ENV"
echo "snapshot_version=$(./ci/version_determiner.py snapshot-version $release_type)" >> "$GITHUB_ENV"
env:
release_type: ${{ inputs.release }}
- name: Print new versions
run: |
echo "Release version: $release_version"
echo "Version tag: $version_tag"
echo "Snapshot version: $snapshot_version"
- name: Configure Git user
run: |
git config user.email "actions+bumper@users.noreply.github.com"
git config user.name "GitHub Actions Bumper"
- name: Bump to release version and tag
run: |
./ci/version_writer.py $release_version
git commit --all --message "Bump version to $release_version"
git tag --annotate --message "Release $version_tag" $version_tag
- name: Bump to snapshot version
run: |
./ci/version_writer.py $snapshot_version
git commit --all --message "Bump version to $snapshot_version"
- name: Push version changes and tag
uses: ad-m/github-push-action@master
with:
tags: true