Skip to content

Commit 8aff92c

Browse files
authored
Merge pull request #2 from dsp-testing/henrymercer/use-tags-for-releases
Henrymercer/use tags for releases
2 parents bb1ef50 + 74d33fe commit 8aff92c

30 files changed

+114
-105
lines changed

.github/update-release-branch.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
# Value of the mode flag for a v2 release
2020
V2_MODE = 'v2-release'
2121

22+
SOURCE_BRANCH_FOR_MODE = { V1_MODE: 'releases/v2', V2_MODE: 'main' }
23+
TARGET_BRANCH_FOR_MODE = { V1_MODE: 'releases/v1', V2_MODE: 'releases/v2' }
24+
2225
# Name of the remote
2326
ORIGIN = 'origin'
2427

@@ -198,8 +201,10 @@ def main():
198201
type=str,
199202
required=True,
200203
choices=[V2_MODE, V1_MODE],
201-
help=f"Which release to perform. '{V2_MODE}' uses main as the source branch and v2 as the target branch. " +
202-
f"'{V1_MODE}' uses v2 as the source branch and v1 as the target branch."
204+
help=f"Which release to perform. '{V2_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V2_MODE]} as the source " +
205+
f"branch and {TARGET_BRANCH_FOR_MODE[V2_MODE]} as the target branch. " +
206+
f"'{V1_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V1_MODE]} as the source branch and " +
207+
f"{TARGET_BRANCH_FOR_MODE[V1_MODE]} as the target branch."
203208
)
204209
parser.add_argument(
205210
'--conductor',
@@ -210,14 +215,8 @@ def main():
210215

211216
args = parser.parse_args()
212217

213-
if args.mode == V2_MODE:
214-
source_branch = 'main'
215-
target_branch = 'v2'
216-
elif args.mode == V1_MODE:
217-
source_branch = 'v2'
218-
target_branch = 'v1'
219-
else:
220-
raise ValueError(f"Unexpected value for release mode: '{args.mode}'")
218+
source_branch = SOURCE_BRANCH_FOR_MODE[args.mode]
219+
target_branch = TARGET_BRANCH_FOR_MODE[args.mode]
221220

222221
repo = Github(args.github_token).get_repo(args.repository_nwo)
223222
version = get_current_version()
@@ -259,9 +258,9 @@ def main():
259258
conflicted_files = []
260259

261260
if args.mode == V1_MODE:
262-
# If we're performing a backport, start from the v1 branch
263-
print(f'Creating {new_branch_name} from the {ORIGIN}/v1 branch')
264-
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/v1')
261+
# If we're performing a backport, start from the target branch
262+
print(f'Creating {new_branch_name} from the {ORIGIN}/{target_branch} branch')
263+
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{target_branch}')
265264

266265
# Revert the commit that we made as part of the last release that updated the version number and
267266
# changelog to refer to 1.x.x variants. This avoids merge conflicts in the changelog and

.github/workflows/__analyze-ref-input.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__debug-artifacts.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__extractor-ram-threads.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-queries.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-tracing-autobuild.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-tracing.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__javascript-source-root.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__ml-powered-queries.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__multi-language-autodetect.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)