@@ -125,7 +125,9 @@ def main():
125
125
)
126
126
]
127
127
128
+
128
129
branch_options = [
130
+ click .option ("--ref" , envvar = "RH_REF" , help = "The source reference" ),
129
131
click .option ("--branch" , envvar = "RH_BRANCH" , help = "The target branch" ),
130
132
click .option ("--repo" , envvar = "RH_REPOSITORY" , help = "The git repo" ),
131
133
]
@@ -216,9 +218,9 @@ def list_envvars():
216
218
@add_options (auth_options )
217
219
@add_options (username_options )
218
220
@add_options (git_url_options )
219
- def prep_git (branch , repo , auth , username , git_url ):
221
+ def prep_git (ref , branch , repo , auth , username , git_url ):
220
222
"""Prep git and env variables and bump version"""
221
- lib .prep_git (branch , repo , auth , username , git_url )
223
+ lib .prep_git (ref , branch , repo , auth , username , git_url )
222
224
223
225
224
226
@main .command ()
@@ -233,7 +235,7 @@ def bump_version(version_spec, version_cmd):
233
235
@main .command ()
234
236
@add_options (changelog_options )
235
237
@use_checkout_dir ()
236
- def build_changelog (branch , repo , auth , changelog_path , resolve_backports ):
238
+ def build_changelog (ref , branch , repo , auth , changelog_path , resolve_backports ):
237
239
"""Build changelog entry"""
238
240
changelog .build_entry (branch , repo , auth , changelog_path , resolve_backports )
239
241
@@ -244,7 +246,7 @@ def build_changelog(branch, repo, auth, changelog_path, resolve_backports):
244
246
@add_options (auth_options )
245
247
@add_options (dry_run_options )
246
248
@use_checkout_dir ()
247
- def draft_changelog (version_spec , branch , repo , auth , dry_run ):
249
+ def draft_changelog (version_spec , ref , branch , repo , auth , dry_run ):
248
250
"""Create a changelog entry PR"""
249
251
lib .draft_changelog (version_spec , branch , repo , auth , dry_run )
250
252
@@ -255,7 +257,7 @@ def draft_changelog(version_spec, branch, repo, auth, dry_run):
255
257
"--output" , envvar = "RH_CHANGELOG_OUTPUT" , help = "The output file for changelog entry"
256
258
)
257
259
@use_checkout_dir ()
258
- def check_changelog (branch , repo , auth , changelog_path , resolve_backports , output ):
260
+ def check_changelog (ref , branch , repo , auth , changelog_path , resolve_backports , output ):
259
261
"""Check changelog entry"""
260
262
changelog .check_entry (branch , repo , auth , changelog_path , resolve_backports , output )
261
263
@@ -357,17 +359,16 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
357
359
358
360
359
361
@main .command ()
360
- @add_options (branch_options )
361
362
@add_options (dist_dir_options )
362
363
@click .option (
363
364
"--no-git-tag-workspace" ,
364
365
is_flag = True ,
365
366
help = "Whether to skip tagging npm workspace packages" ,
366
367
)
367
368
@use_checkout_dir ()
368
- def tag_release (branch , repo , dist_dir , no_git_tag_workspace ):
369
+ def tag_release (dist_dir , no_git_tag_workspace ):
369
370
"""Create release commit and tag"""
370
- lib .tag_release (branch , repo , dist_dir , no_git_tag_workspace )
371
+ lib .tag_release (dist_dir , no_git_tag_workspace )
371
372
372
373
373
374
@main .command ()
@@ -385,6 +386,7 @@ def tag_release(branch, repo, dist_dir, no_git_tag_workspace):
385
386
@click .argument ("assets" , nargs = - 1 )
386
387
@use_checkout_dir ()
387
388
def draft_release (
389
+ ref ,
388
390
branch ,
389
391
repo ,
390
392
auth ,
@@ -397,6 +399,7 @@ def draft_release(
397
399
):
398
400
"""Publish Draft GitHub release"""
399
401
lib .draft_release (
402
+ ref ,
400
403
branch ,
401
404
repo ,
402
405
auth ,
@@ -421,53 +424,58 @@ def delete_release(auth, release_url):
421
424
@add_options (auth_options )
422
425
@add_options (dist_dir_options )
423
426
@add_options (dry_run_options )
424
- @click .argument ("release_url " , nargs = 1 )
427
+ @click .argument ("release-url " , nargs = 1 )
425
428
def extract_release (auth , dist_dir , dry_run , release_url ):
426
429
"""Download and verify assets from a draft GitHub release"""
427
430
lib .extract_release (auth , dist_dir , dry_run , release_url )
428
431
429
432
430
433
@main .command ()
431
- @add_options (auth_options )
432
434
@add_options (dist_dir_options )
433
- @click .option ("--npm_token " , help = "A token for the npm release" , envvar = "NPM_TOKEN" )
435
+ @click .option ("--npm-token " , help = "A token for the npm release" , envvar = "NPM_TOKEN" )
434
436
@click .option (
435
- "--npm_cmd " ,
437
+ "--npm-cmd " ,
436
438
help = "The command to run for npm release" ,
437
439
envvar = "RH_NPM_COMMAND" ,
438
440
default = "npm publish" ,
439
441
)
440
442
@click .option (
441
- "--twine_cmd " ,
443
+ "--twine-cmd " ,
442
444
help = "The twine to run for Python release" ,
443
445
envvar = "TWINE_COMMAND" ,
444
446
default = "twine upload" ,
445
447
)
448
+ @click .option ("--use-checkout-dir" , help = "Use the checkout directory" , is_flag = True )
446
449
@add_options (dry_run_options )
447
- @click .argument ("release_url" , nargs = 1 )
448
- def publish_release (
449
- auth , dist_dir , npm_token , npm_cmd , twine_cmd , dry_run , release_url
450
- ):
451
- """Publish release asset(s) and finalize GitHub release"""
452
- lib .publish_release (
453
- auth , dist_dir , npm_token , npm_cmd , twine_cmd , dry_run , release_url
450
+ def publish_assets (dist_dir , npm_token , npm_cmd , twine_cmd , dry_run , use_checkout_dir ):
451
+ """Publish release asset(s)"""
452
+ lib .publish_assets (
453
+ dist_dir , npm_token , npm_cmd , twine_cmd , dry_run , use_checkout_dir
454
454
)
455
455
456
456
457
+ @main .command ()
458
+ @add_options (auth_options )
459
+ @click .argument ("release-url" , nargs = 1 )
460
+ def publish_release (auth , release_url ):
461
+ """Publish GitHub release"""
462
+ lib .publish_release (auth , release_url )
463
+
464
+
457
465
@main .command ()
458
466
@add_options (auth_options )
459
467
@add_options (branch_options )
460
468
@add_options (username_options )
461
469
@add_options (changelog_path_options )
462
470
@add_options (dry_run_options )
463
471
@add_options (git_url_options )
464
- @click .argument ("release_url " )
472
+ @click .argument ("release-url " )
465
473
def forwardport_changelog (
466
- auth , branch , repo , username , changelog_path , dry_run , git_url , release_url
474
+ auth , ref , branch , repo , username , changelog_path , dry_run , git_url , release_url
467
475
):
468
476
"""Forwardport Changelog Entries to the Default Branch"""
469
477
lib .forwardport_changelog (
470
- auth , branch , repo , username , changelog_path , dry_run , git_url , release_url
478
+ auth , ref , branch , repo , username , changelog_path , dry_run , git_url , release_url
471
479
)
472
480
473
481
0 commit comments