Nightlies workflow: Enable skipping OS's

part of CURA-9494
This commit is contained in:
Remco Burema 2023-09-07 20:34:54 +02:00
parent c716ff8dfe
commit 13af77b4f6

View file

@ -29,6 +29,11 @@ on:
default: false
required: true
type: boolean
os_list:
description: 'List of OS(-variant)s to build for'
default: "windows, linux-modern, linux-legacy, macos-x64, macos-arm64"
required: true
type: string
schedule:
# Daily at 5:20 CET
- cron: '20 4 * * *'
@ -40,59 +45,74 @@ env:
jobs:
windows-installer:
uses: ./.github/workflows/windows.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: windows-2022
secrets: inherit
steps:
- name: Build Windows installer
if: ${{ contains(inputs.os_list, "windows") }}
uses: ./.github/workflows/windows.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: windows-2022
secrets: inherit
linux-modern-installer:
uses: ./.github/workflows/linux.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: ubuntu-22.04
secrets: inherit
steps:
- name: Build (modern) Linux installer
if: ${{ contains(inputs.os_list, "linux-modern") }}
uses: ./.github/workflows/linux.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: ubuntu-22.04
secrets: inherit
linux-legacy-installer:
uses: ./.github/workflows/linux.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: ubuntu-20.04
secrets: inherit
steps:
- name: Build (legacy) Linux installer
if: ${{ contains(inputs.os_list, "linux-legacy") }}
uses: ./.github/workflows/linux.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: ubuntu-20.04
secrets: inherit
macos-installer:
uses: ./.github/workflows/macos.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: macos-11.0
secrets: inherit
steps:
- name: Build MacOS installer for Intel chips
if: ${{ contains(inputs.os_list, "macos-x64") }}
uses: ./.github/workflows/macos.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: X64
operating_system: macos-11.0
secrets: inherit
macos-arm-installer:
uses: ./.github/workflows/macos.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: ARM64
operating_system: self-hosted
secrets: inherit
steps:
- name: Build MacOS installer for ARM chips
if: ${{ contains(inputs.os_list, "macos-arm64") }}
uses: ./.github/workflows/macos.yml
with:
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
architecture: ARM64
operating_system: self-hosted
secrets: inherit
# Run and update nightly release when the nightly input is set to true or if the schedule is triggered
update-nightly-release:
@ -119,14 +139,20 @@ jobs:
import os
import datetime
enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else ""
linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64"
linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64"
mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
os_list = [x.strip() for x in "${{ inputs.os_list }}".split(",")]
if "linux-modern" in os_list:
linux_modern = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-modern-X64"
if "linux-legacy" in os_list:
linux_legacy = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64"
if "macos-x64" in os_list:
mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
if "macos-arm64" in os_list:
mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
if "windows" in os_list:
win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0]
nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
output_env = os.environ["GITHUB_OUTPUT"]
@ -136,84 +162,139 @@ jobs:
content = f.read()
with open(output_env, "w") as f:
f.write(content)
f.writelines(f"LINUX_MODERN={linux_modern}\n")
f.writelines(f"LINUX_LEGACY={linux_legacy}\n")
f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n")
f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n")
f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n")
f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n")
f.writelines(f"WIN_MSI={win_msi}\n")
f.writelines(f"WIN_EXE={win_exe}\n")
if "linux-modern" in os_list:
f.writelines(f"LINUX_MODERN={linux_modern}\n")
if "linux-legacy" in os_list:
f.writelines(f"LINUX_LEGACY={linux_legacy}\n")
if "macos-x64" in os_list:
f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n")
f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n")
if "macos-arm64" in os_list:
f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n")
f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n")
if "windows" in os_list:
f.writelines(f"WIN_MSI={win_msi}\n")
f.writelines(f"WIN_EXE={win_exe}\n")
f.writelines(f"NIGHTLY_NAME={nightly_name}\n")
f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n")
- name: Download linux modern installer jobs artifacts
if: ${{ contains(inputs.os_list, "linux-modern") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage
path: installers
- name: Download linux legacy installer jobs artifacts
if: ${{ contains(inputs.os_list, "linux-legacy") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.LINUX_LEGACY }}-AppImage
path: installers
- name: Download mac x64 dmg installer jobs artifacts
if: ${{ contains(inputs.os_list, "macos-x64") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
path: installers
- name: Download mac x64 pkg installer jobs artifacts
if: ${{ contains(inputs.os_list, "macos-x64") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg
path: installers
- name: Download mac arm dmg installer jobs artifacts
if: ${{ contains(inputs.os_list, "macos-arm64") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg
path: installers
- name: Download mac arm pkg installer jobs artifacts
if: ${{ contains(inputs.os_list, "macos-arm64") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg
path: installers
- name: Download win msi installer jobs artifacts
if: ${{ contains(inputs.os_list, "windows") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.WIN_MSI }}-msi
path: installers
- name: Download win exe installer jobs artifacts
if: ${{ contains(inputs.os_list, "windows") }}
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.WIN_EXE }}-exe
path: installers
- name: Rename installers to nightlies
- name: Rename Linux (modern) installer to nightlies
if: ${{ contains(inputs.os_list, "linux-modern") }}
run: |
mv installers/${{ steps.filename.outputs.LINUX_MODERN }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage
- name: Rename Linux (legacy) installer to nightlies
if: ${{ contains(inputs.os_list, "linux-legacy") }}
run: |
mv installers/${{ steps.filename.outputs.LINUX_LEGACY }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage
- name: Rename MacOS (X64) installers to nightlies
if: ${{ contains(inputs.os_list, "macos-x64") }}
run: |
mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg
mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg
- name: Rename MacOS (ARM-64) installers to nightlies
if: ${{ contains(inputs.os_list, "macos-arm64") }}
run: |
mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg
mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg
- name: Rename Windows installers to nightlies
if: ${{ contains(inputs.os_list, "windows") }}
run: |
mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi
mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe
- name: Update nightly release
- name: Update nightly release for Linux (modern)
if: ${{ contains(inputs.os_list, "linux-modern") }}
run: |
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-modern-X64.AppImage --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update nightly release for Linux (legacy)
if: ${{ contains(inputs.os_list, "linux-legacy") }}
run: |
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update nightly release for MacOS (X64)
if: ${{ contains(inputs.os_list, "macos-x64") }}
run: |
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update nightly release for MacOS (ARM-64)
if: ${{ contains(inputs.os_list, "macos-arm64") }}
run: |
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update nightly release for Windows
if: ${{ contains(inputs.os_list, "windows") }}
run: |
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber
env:
@ -224,4 +305,3 @@ jobs:
gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}