From 8f35c606d1e0cdd02781f56293704c2b31f22624 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 1 Nov 2023 10:42:50 +0100 Subject: [PATCH] Update daily schedule and conditional logic in installers workflow The github actions workflow `installers.yml` has been updated to adjust the daily cron schedule for the main and release branches. Additionally, the conditional logic related to the cura conan version and release tag has been simplified and cleaned up for better readability and maintainability. With these changes, the release process should perform more consistently. --- .github/workflows/installers.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 7821577462..3034c80e59 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -31,21 +31,23 @@ on: type: boolean schedule: - # Daily at 4:15 CET (main-branch) and 9:15 CET (release-branch) - - cron: '15 2 * * *' - - cron: '15 8 * * *' + # Daily at 4:15 CET (main-branch) and 5:15 CET (release-branch) + - cron: '15 3 * * *' + - cron: '15 4 * * *' env: - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }} CONAN_ARGS: ${{ inputs.conan_args || '' }} ENTERPRISE: ${{ inputs.enterprise || false }} STAGING: ${{ inputs.staging || false }} + LATEST_RELEASE: '5.6' + LATEST_RELEASE_SCHEDULE_HOUR: 4 jobs: default-values: runs-on: ubuntu-latest outputs: cura_conan_version: ${{ steps.default.outputs.cura_conan_version }} + release_tag: ${{ steps.default.outputs.release_tag }} steps: - name: Output default values @@ -54,17 +56,15 @@ jobs: run: | import os import datetime - cura_conan_version = "cura/latest@ultimaker/testing" - release_tag = "nightly" - - # Get current UTC time - now = datetime.datetime.utcnow() - - # Check if current hour is 8 and it is a schedule event - if "${{ github.event_name }}" == "schedule" and now.hour == 8: - cura_conan_version = "cura/latest@ultimaker/stable" - release_tag = "nightly-5.6" - + + if "${{ github.event_name }}" != "schedule": + cura_conan_version = "${{ github.event.inputs.cura_conan_version }}" + else: + now = datetime.datetime.now() + cura_conan_version = "cura/latest@ultimaker/stable" if now.hour == int(os.environ['LATEST_RELEASE_SCHEDULE_HOUR']) else "cura/latest@ultimaker/testing" + + release_tag = f"nightly-{os.environ['LATEST_RELEASE']}" if "/stable" in cura_conan_version else "nightly" + # Set cura_conan_version environment variable output_env = os.environ["GITHUB_OUTPUT"] content = ""