Skip to content

Commit

Permalink
Set up main -> v2, v2 -> v1, and v2 -> main merges
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed Mar 24, 2022
1 parent ccda44c commit 33f749f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/post-release-mergeback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
push:
branches:
- v1
- v2

jobs:
merge-back:
Expand Down Expand Up @@ -90,7 +91,7 @@ jobs:
git push origin --follow-tags "$VERSION"
- name: Create mergeback branch
if: steps.check.outputs.exists != 'true'
if: steps.check.outputs.exists != 'true' && contains(github.ref, 'v2')
env:
VERSION: "${{ steps.getVersion.outputs.version }}"
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/update-release-branch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Update release branch
on: workflow_dispatch
on:
# You can trigger this workflow via workflow dispatch to start a release.
# This will open a PR to update the v2 release branch.
workflow_dispatch:

# When the v2 release is complete, this workflow will open a PR to update the v1 release branch.
push:
branches:
- v2

jobs:
update:
Expand Down Expand Up @@ -27,11 +35,22 @@ jobs:
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"
- name: Update release branch
- name: Update v2 release branch
if: github.event_name == 'workflow_dispatch'
run: |
python .github/update-release-branch.py \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--repository-nwo ${{ github.repository }} \
--source-branch main \
--target-branch v2 \
--conductor ${GITHUB_ACTOR}
- name: Update v1 release branch
if: github.event_name == 'push'
run: |
python .github/update-release-branch.py \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--repository-nwo ${{ github.repository }} \
--source-branch v2 \
--target-branch v1 \
--conductor ${GITHUB_ACTOR}

0 comments on commit 33f749f

Please sign in to comment.