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 workflows for publishing to year #1838

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/publish_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ jobs:
exit 0
fi;

git fetch origin ${{ secrets.STABLE_YEAR }}
(git checkout ${{ secrets.STABLE_YEAR }} && git pull) || git checkout -b ${{ secrets.STABLE_YEAR }} origin/${{ secrets.STABLE_YEAR }}

git merge --ff-only main
git merge --ff-only ${{ secrets.STABLE_YEAR }}

- name: Push
if: env.PUBLISH_STABLE == 'true' || github.event.action == 'workflow_dispatch'
env:
PUBLISH_STABLE: ${{ secrets.PUBLISH_STABLE }}
run: |
git push origin stable
git push origin ${{ secrets.STABLE_YEAR }}
40 changes: 40 additions & 0 deletions .github/workflows/publish_year.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Stable to Year
on:
push:
branches:
- stable
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'wpilibsuite' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Merge
run: |
git config user.name github-actions
git config user.email [email protected]
git config pull.ff only

git fetch origin stable
(git checkout stable && git pull) || git checkout -b stable origin/stable

git fetch origin ${{ secrets.STABLE_YEAR }}
(git checkout ${{ secrets.STABLE_YEAR }} && git pull) || git checkout -b ${{ secrets.STABLE_YEAR }} origin/${{ secrets.STABLE_YEAR }}

if git merge-base --is-ancestor stable ${{ secrets.STABLE_YEAR }}; then
echo "No merge is necessary"
exit 0
fi;

git merge --ff-only stable

- name: Push
if: env.PUBLISH_STABLE == 'true' || github.event.action == 'workflow_dispatch'
env:
PUBLISH_STABLE: ${{ secrets.PUBLISH_STABLE }}
run: |
git push origin ${{ secrets.STABLE_YEAR }}