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.
This commit is contained in:
Jelle Spijker 2023-11-01 10:42:50 +01:00
parent 56e4f3ffce
commit 8f35c606d1
No known key found for this signature in database
GPG Key ID: 034D1C0527888B65

View File

@ -31,21 +31,23 @@ on:
type: boolean type: boolean
schedule: schedule:
# Daily at 4:15 CET (main-branch) and 9:15 CET (release-branch) # Daily at 4:15 CET (main-branch) and 5:15 CET (release-branch)
- cron: '15 2 * * *' - cron: '15 3 * * *'
- cron: '15 8 * * *' - cron: '15 4 * * *'
env: env:
CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }}
CONAN_ARGS: ${{ inputs.conan_args || '' }} CONAN_ARGS: ${{ inputs.conan_args || '' }}
ENTERPRISE: ${{ inputs.enterprise || false }} ENTERPRISE: ${{ inputs.enterprise || false }}
STAGING: ${{ inputs.staging || false }} STAGING: ${{ inputs.staging || false }}
LATEST_RELEASE: '5.6'
LATEST_RELEASE_SCHEDULE_HOUR: 4
jobs: jobs:
default-values: default-values:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
cura_conan_version: ${{ steps.default.outputs.cura_conan_version }} cura_conan_version: ${{ steps.default.outputs.cura_conan_version }}
release_tag: ${{ steps.default.outputs.release_tag }}
steps: steps:
- name: Output default values - name: Output default values
@ -54,16 +56,14 @@ jobs:
run: | run: |
import os import os
import datetime import datetime
cura_conan_version = "cura/latest@ultimaker/testing"
release_tag = "nightly"
# Get current UTC time if "${{ github.event_name }}" != "schedule":
now = datetime.datetime.utcnow() 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"
# Check if current hour is 8 and it is a schedule event release_tag = f"nightly-{os.environ['LATEST_RELEASE']}" if "/stable" in cura_conan_version else "nightly"
if "${{ github.event_name }}" == "schedule" and now.hour == 8:
cura_conan_version = "cura/latest@ultimaker/stable"
release_tag = "nightly-5.6"
# Set cura_conan_version environment variable # Set cura_conan_version environment variable
output_env = os.environ["GITHUB_OUTPUT"] output_env = os.environ["GITHUB_OUTPUT"]