Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release process to maintain both v2 and v1 releases #995

Merged
merged 22 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2a7a517
Remove unused `repository_dispatch` trigger
henrymercer Mar 17, 2022
b386fd4
Parameterize release branch workflow over source and target branches
henrymercer Mar 17, 2022
81827d3
Use the person triggering the release workflow as the conductor
henrymercer Mar 17, 2022
ccda44c
Handle missing author information when generating changelog
henrymercer Mar 17, 2022
33f749f
Set up `main -> v2`, `v2 -> v1`, and `v2 -> main` merges
henrymercer Mar 17, 2022
d76b182
Add functionality for `v2 -> v1` backports
henrymercer Mar 17, 2022
4b465cb
Dump environment and GitHub context
henrymercer Mar 22, 2022
b8f3a37
Fix exception when there are no commits to merge
henrymercer Mar 22, 2022
124e7d9
Stop versioning the runner
henrymercer Mar 22, 2022
5fb01dd
Avoid commits with duplicate names during v2 to v1 backport
henrymercer Mar 22, 2022
bd4757c
Update the changelog and version number in a single commit
henrymercer Mar 22, 2022
1668e0a
Only mention merging the mergeback PR in the checklist when relevant
henrymercer Mar 22, 2022
0b037b4
Add merging the v1 release PR to the checklist
henrymercer Mar 23, 2022
f143182
Add "Update dependencies" label to v1 release PR
henrymercer Mar 23, 2022
3359990
Avoid conflicts by reverting 1.x version num commit from last v1 release
henrymercer Mar 23, 2022
da7944b
Update release process doc
henrymercer Mar 24, 2022
9d26fe0
Use source branch and target branch names consistently
henrymercer Mar 25, 2022
bed132d
Use a more restrictive `sed` pattern
henrymercer Mar 25, 2022
d0bd808
Expose a more restrictive interface to the release script
henrymercer Mar 25, 2022
f784647
Merge branch 'main' into henrymercer/update-release-process
henrymercer Mar 25, 2022
044f112
Update branch protection instructions
henrymercer Mar 25, 2022
839aa81
Merge branch 'main' into henrymercer/update-release-process
henrymercer Mar 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add functionality for v2 -> v1 backports
  • Loading branch information
henrymercer committed Mar 24, 2022
commit d76b18254a7f9e0d84958be7cf2faa59badfdf7f
23 changes: 21 additions & 2 deletions .github/update-release-branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,22 @@ def main():
required=True,
help='The GitHub handle of the person who is conducting the release process.'
)
parser.add_argument(
'--perform-v2-to-v1-backport',
action='store_true',
help='Pass this flag if this release is a backport from v2 to v1.'
)

args = parser.parse_args()

repo = Github(args.github_token).get_repo(args.repository_nwo)
version = get_current_version()

if args.perform_v2_to_v1_backport:
# Change the version number to a v1 equivalent
version = get_current_version()
version = f'1{version[1:]}'

# Print what we intend to go
print('Considering difference between ' + args.source_branch + ' and ' + args.target_branch)
short_main_sha = run_git('rev-parse', '--short', ORIGIN + '/' + args.source_branch).strip()
Expand Down Expand Up @@ -226,8 +236,17 @@ def main():
print('Creating branch ' + new_branch_name)
run_git('checkout', '-b', new_branch_name, ORIGIN + '/' + args.source_branch)

print('Updating changelog')
update_changelog(version)
if args.perform_v2_to_v1_backport:
print(f'Setting version number to {version}')
subprocess.run(['npm', 'version', version])
run_git('add', 'package.json', 'package-lock.json', 'runner/package.json', 'runner/package-lock.json')

print('Migrating changelog notes from v2 to v1')
subprocess.run(['sed', '-i', 's/## 2./## 1./g', 'CHANGELOG.md'])
else:
# We don't need to do this for a v1 release, since the changelog has already been updated in the v2 branch.
print('Updating changelog')
update_changelog(version)

# Create a commit that updates the CHANGELOG
run_git('add', 'CHANGELOG.md')
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ jobs:
--repository-nwo ${{ github.repository }} \
--source-branch v2 \
--target-branch v1 \
--conductor ${GITHUB_ACTOR}
--conductor ${GITHUB_ACTOR} \
--perform-v2-to-v1-backport