Build: Nightly - master branch #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build: Nightly" | |
run-name: "${{ github.event.schedule == '0 3 * * *' && 'Build: Nightly - master branch' || 'Build: Nightly - current release branch' }}" | |
on: | |
schedule: | |
- cron: "0 3 * * *" # Every night at 03:00 for master branch | |
- cron: "0 4 * * *" # Every night at 04:00 for current release branch | |
workflow_dispatch: | |
permissions: | |
actions: write | |
env: | |
CURRENT_RELEASE_BRANCH: 4.4.4 | |
IS_CURRENT_RELEASE_BRANCH: ${{ github.event.schedule == '0 4 * * *' && 'true' || 'false' }} | |
jobs: | |
trigger_nightly: | |
name: "Trigger nightly builds" | |
if: github.event_name != 'schedule' || github.repository == 'musescore/MuseScore' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger nightly builds | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
let ref; | |
if (context.eventName == 'schedule') { | |
if (process.env.IS_CURRENT_RELEASE_BRANCH == 'true') { | |
ref = process.env.CURRENT_RELEASE_BRANCH; | |
if (!ref) { | |
core.notice('CURRENT_RELEASE_BRANCH is empty; exiting'); | |
return; | |
} | |
} else { | |
ref = 'master'; | |
} | |
} else { | |
ref = context.ref.replace(/^(refs\/heads\/)/, ""); | |
} | |
await github.rest.actions.createWorkflowDispatch({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
workflow_id: 'build_all.yml', | |
ref: ref, | |
inputs: { | |
platforms: 'linux_arm32 linux_arm64 linux_x64 macos windows_x64 windows_portable', | |
build_mode: 'nightly', | |
publish: 'on', | |
sentry_project: 'sandbox' | |
} | |
}) |