9
9
inputs :
10
10
ref :
11
11
description : |
12
- The release branch to finalize.
12
+ The ref of release to finalize (e.g., 'rc/MAJOR.MINOR.PATCH') .
13
13
required : true
14
+ tool-ref :
15
+ description : |
16
+ The ref to the tooling to use for the finalize (e.g., 'rc/MAJOR.MINOR.PATCH').
17
+ required : false
14
18
15
19
jobs :
16
20
finalize-release :
@@ -20,14 +24,17 @@ jobs:
20
24
- name : Determine ref
21
25
env :
22
26
REF_FROM_INPUT : ${{ inputs.ref }}
27
+ TOOL_REF_FROM_INPUT : ${{ inputs.tool-ref }}
23
28
REF_FROM_PR : ${{ github.event.pull_request.merge_commit_sha }}
24
29
BASE_REF_FROM_PR : ${{ github.event.pull_request.base.ref }}
25
30
run : |
26
31
if [[ $GITHUB_EVENT_NAME == "workflow_dispatch" ]]; then
27
32
echo "REF=$REF_FROM_INPUT" >> "$GITHUB_ENV"
33
+ echo "TOOL_REF=$TOOL_REF_FROM_INPUT" >> "$GITHUB_ENV"
28
34
echo "BASE_REF=$REF_FROM_INPUT" >> "$GITHUB_ENV"
29
35
else
30
36
echo "REF=$REF_FROM_PR" >> "$GITHUB_ENV"
37
+ echo "TOOL_REF=$REF_FROM_PR" >> "$GITHUB_ENV"
31
38
echo "BASE_REF=$BASE_REF_FROM_PR" >> "$GITHUB_ENV"
32
39
fi
33
40
36
43
with :
37
44
ref : ${{ env.REF }}
38
45
fetch-depth : 0
46
+ path : release
47
+
48
+ - name : Checkout
49
+ uses : actions/checkout@v4
50
+ with :
51
+ ref : ${{ env.TOOL_REF }}
52
+ path : tooling
39
53
40
54
- name : Install Python
41
55
uses : actions/setup-python@v4
@@ -44,11 +58,13 @@ jobs:
44
58
45
59
- name : Install dependencies
46
60
run : pip install -r scripts/release/requirements.txt
61
+ working-directory : tooling
47
62
48
63
- name : Configure git
49
64
run : |
50
65
git config user.name "$GITHUB_ACTOR"
51
66
git config user.email "[email protected] "
67
+ working-directory : release
52
68
53
69
- name : Update release tag
54
70
run : |
57
73
58
74
git tag -f -a v$version -m "Release v$version"
59
75
git push --force origin v$version
76
+ working-directory : release
60
77
61
78
- name : Finalize release
62
79
env :
@@ -66,30 +83,40 @@ jobs:
66
83
echo "Finalizing release v$version"
67
84
68
85
gh release edit "v$version" --draft=false --tag=v$version
86
+ working-directory : release
69
87
70
88
- name : Determine if release was a hotfix release
71
89
run : |
72
90
version=${BASE_REF#rc/}
73
- echo "HOTFIX_RELEASE=$(python scripts/release/is-hotfix-release.py $version)" >> "$GITHUB_ENV"
91
+ # We are running the script in the tooling directory with the release directory as the working directory
92
+ echo "HOTFIX_RELEASE=$(python ../tooling/scripts/release/is-hotfix-release.py $version)" >> "$GITHUB_ENV"
93
+ working-directory : release
94
+
95
+ - name : Determine next release version
96
+ if : env.HOTFIX_RELEASE == 'false'
97
+ run : |
98
+ version=${BASE_REF#rc/}
99
+ next_version=$(python scripts/release/next-version.py --component minor --pre-release dev -- $version)
100
+ echo "NEXT_VERSION=$next_version" >> "$GITHUB_ENV"
101
+ working-directory : tooling
74
102
75
103
- name : Bump main version
76
- if : env.HOTFIX_RELEASE == 'false'
77
104
env :
78
105
GH_TOKEN : ${{ github.token }}
79
106
run : |
80
- version=${BASE_REF#rc/}
81
- next_version=$(python scripts/release/next-version.py --component minor --pre-release dev -- $version)
82
- echo "Bumping main version to $next_version"
107
+ echo "Bumping main version to $NEXT_VERSION"
83
108
84
109
git switch main
85
110
git pull --ff-only origin main
86
111
87
112
git switch -c release-automation/bump-version
88
113
89
- ./scripts/release/bump-version.sh "$next_version"
114
+ # We are running the script in the tooling directory with the release directory as the working directory
115
+ ../tooling/scripts/release/bump-version.sh "$NEXT_VERSION"
90
116
91
117
git add -u .
92
- git commit -m "Bump version to $next_version "
118
+ git commit -m "Bump version to $NEXT_VERSION "
93
119
git push --set-upstream origin release-automation/bump-version
94
120
95
- gh pr create --repo $GITHUB_REPOSITORY --base main --head release-automation/bump-version --body "Bump the version of main to the dev label of the just released version $next_version" --title "Bump version to $next_version"
121
+ gh pr create --repo $GITHUB_REPOSITORY --base main --head release-automation/bump-version --body "Bump the version of main to $NEXT_VERSION" --title "Bump version to $NEXT_VERSION"
122
+ working-directory : release
0 commit comments