Set up main -> v2, v2 -> v1, and v2 -> main merges

This commit is contained in:
Henry Mercer 2022-03-17 19:11:37 +00:00
parent ccda44cac5
commit 33f749f1c9
2 changed files with 23 additions and 3 deletions

View file

@ -15,6 +15,7 @@ on:
push: push:
branches: branches:
- v1 - v1
- v2
jobs: jobs:
merge-back: merge-back:
@ -90,7 +91,7 @@ jobs:
git push origin --follow-tags "$VERSION" git push origin --follow-tags "$VERSION"
- name: Create mergeback branch - name: Create mergeback branch
if: steps.check.outputs.exists != 'true' if: steps.check.outputs.exists != 'true' && contains(github.ref, 'v2')
env: env:
VERSION: "${{ steps.getVersion.outputs.version }}" VERSION: "${{ steps.getVersion.outputs.version }}"
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}" NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"

View file

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