Skip to content

Update nightly from develop #14

Update nightly from develop

Update nightly from develop #14

name: Update nightly from develop
on:
schedule:
- cron: '7 1 * * *'
workflow_dispatch:
inputs:
force:
type: boolean
description: Forcibly reset Nightly to Develop?
default: false
jobs:
make_nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- name: Fetch all branches
run: git fetch --all
- name: Determine if develop is ahead of nightly
if: inputs.force != 'true'
id: compare_branches
run: |
if git rev-list --left-right --count origin/develop...origin/nightly | grep -q "0$"; then
if git rev-list --left-right --count origin/develop...origin/nightly | grep -qv "^0"; then
echo "behind=true" >> $GITHUB_OUTPUT
else
echo "behind=false" >> $GITHUB_OUTPUT
fi
else
echo "There are changes to Nightly that are not in develop, we can't automatically update"
echo "To forcibly reset Nightly please have an admin run this action with 'force' enabled"
exit 1
fi
- name: Fast-forward nightly branch if behind develop
if: steps.compare_branches.outputs.behind == 'true'
run: |
git checkout nightly
git merge develop --ff-only
git push origin nightly
env:
GITHUB_TOKEN: ${{ secrets.OPENMS_GITHUB_APP_PRIVATE_KEY }}
- name: Forcibly reset nightly
if: inputs.force
run: |
git checkout nightly
git reset --hard develop
git push origin nightly -f
env:
GITHUB_TOKEN: ${{ secrets.OPENMS_GITHUB_APP_PRIVATE_KEY }}
- name: Call CI
if: steps.compare_branches.outputs.behind == 'true' || inputs.force
run: |
gh workflow run openms-ci-full --ref nightly
env:
GH_TOKEN: ${{ github.token }}
- name: Build Develop for cache
if: steps.compare_branches.outputs.behind == 'true' || inputs.force
run: |
gh workflow run openms-ci-full --ref develop
env:
GH_TOKEN: ${{ github.token }}
- name: Build wheels
if: steps.compare_branches.outputs.behind == 'true' || inputs.force
run: |
gh workflow run pyopenms-wheels-and-packages --ref nightly
env:
GH_TOKEN: ${{ github.token }}