Simplified All Installer workflow

No need to make exceptions in this workflow for different OSes
it's called the **All** Installer for a reason.

If people need a specific OS installer run the linux, macos or windows installer itself.

Added a time-out to the macos workflow if the self-hosted isn't online.
Moved the ARM64 jobs to the end and added an `always()` condition to the update of the release, such that the
GH hosted runners will at least update.

Add missing download for MacOS X64

Contributes to CURA-10475 and CURA-10591
This commit is contained in:
Jelle Spijker 2023-09-11 13:29:02 +02:00
parent 8126b9a6f6
commit 69bdcfa52f
No known key found for this signature in database
GPG key ID: 034D1C0527888B65
4 changed files with 782 additions and 825 deletions

View file

@ -29,11 +29,7 @@ on:
default: false default: false
required: true required: true
type: boolean type: boolean
os_list:
description: 'List of OS(-variant)s to build for'
default: "windows, linux`, macos-x64, macos-arm64"
required: true
type: string
schedule: schedule:
# Daily at 5:20 CET # Daily at 5:20 CET
- cron: '20 4 * * *' - cron: '20 4 * * *'
@ -43,11 +39,9 @@ env:
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 }}
OS_LIST: ${{ inputs.os_list || 'windows, linux, macos-x64, macos-arm64' }}
jobs: jobs:
windows-installer: windows-installer:
if: ${{ contains(github.event.inputs.os_list, 'windows') || github.event_name == 'schedule' }}
uses: ./.github/workflows/windows.yml uses: ./.github/workflows/windows.yml
with: with:
cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }}
@ -58,8 +52,7 @@ jobs:
operating_system: windows-2022 operating_system: windows-2022
secrets: inherit secrets: inherit
linux-modern-installer: linux-installer:
if: ${{ contains(github.event.inputs.os_list, 'linux') || github.event_name == 'schedule' }}
uses: ./.github/workflows/linux.yml uses: ./.github/workflows/linux.yml
with: with:
cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }}
@ -71,7 +64,6 @@ jobs:
secrets: inherit secrets: inherit
macos-installer: macos-installer:
if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || github.event_name == 'schedule' }}
uses: ./.github/workflows/macos.yml uses: ./.github/workflows/macos.yml
with: with:
cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }}
@ -83,7 +75,6 @@ jobs:
secrets: inherit secrets: inherit
macos-arm-installer: macos-arm-installer:
if: ${{ contains(github.event.inputs.os_list, 'macos-arm64') || github.event_name == 'schedule' }}
uses: ./.github/workflows/macos.yml uses: ./.github/workflows/macos.yml
with: with:
cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }} cura_conan_version: ${{ github.event.inputs.CURA_CONAN_VERSION }}
@ -106,23 +97,10 @@ jobs:
# It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped.
- name: Download the run info - name: Download the run info
if: ${{ contains(github.event.inputs.os_list, 'macos-x64') || contains(inputs.os_list, 'macos-arm64') }}
uses: actions/download-artifact@v2
with:
name: macos-run-info
- name: Download the run info II
if: ${{ contains(github.event.inputs.os_list, 'linux') }}
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: linux-run-info name: linux-run-info
- name: Download the run info III
if: ${{ contains(github.event.inputs.os_list, 'windows') }}
uses: actions/download-artifact@v2
with:
name: windows-run-info
- name: Set the run info as environment variables - name: Set the run info as environment variables
run: | run: |
. run_info.sh . run_info.sh
@ -133,18 +111,12 @@ jobs:
run: | run: |
import os import os
import datetime import datetime
enterprise = "-Enterprise" if "${{ env.ENTERPRISE }}" == "true" else "" enterprise = "-Enterprise" if "${{ github.event.inputs.enterprise }}" == "true" else ""
os_list = [x.strip() for x in "${{ env.OS_LIST }}".split(",")] linux = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64"
scheduled = "${{ github.event_name == 'schedule' }}" == "true"
if 'linux-modern' in os_list or scheduled:
linux_modern = 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_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_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_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" mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
if 'windows' in os_list or scheduled:
win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64" 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" 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_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0]
@ -156,124 +128,106 @@ jobs:
content = f.read() content = f.read()
with open(output_env, "w") as f: with open(output_env, "w") as f:
f.write(content) f.write(content)
if 'linux-modern' in os_list or scheduled: f.writelines(f"LINUX={linux}\n")
f.writelines(f"LINUX_MODERN={linux_modern}\n")
if 'macos-x64' in os_list:
f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\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_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_DMG={mac_arm_dmg}\n")
f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n") f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n")
if 'windows' in os_list or scheduled:
f.writelines(f"WIN_MSI={win_msi}\n") f.writelines(f"WIN_MSI={win_msi}\n")
f.writelines(f"WIN_EXE={win_exe}\n") f.writelines(f"WIN_EXE={win_exe}\n")
f.writelines(f"NIGHTLY_NAME={nightly_name}\n") f.writelines(f"NIGHTLY_NAME={nightly_name}\n")
f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n") f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n")
- name: Download linux modern installer jobs artifacts - name: Download linux installer jobs artifacts
if: ${{ contains(github.event.inputs.os_list, 'linux-modern') }}
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: ${{ steps.filename.outputs.LINUX_MODERN }}-AppImage name: ${{ steps.filename.outputs.LINUX }}-AppImage
path: installers path: installers
- name: Download mac x64 dmg installer jobs artifacts - name: Rename Linux installer to nightlies
if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} run: |
uses: actions/download-artifact@v2 mv installers/${{ steps.filename.outputs.LINUX }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage
with:
name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
path: installers
- name: Download mac x64 pkg installer jobs artifacts - name: Update nightly release for Linux
if: ${{ contains(github.event.inputs.os_list, 'macos-x64') }} run: |
uses: actions/download-artifact@v2 gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber
with: env:
name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: installers
- name: Download mac arm dmg installer jobs artifacts
if: ${{ contains(github.event.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(github.event.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 - name: Download win msi installer jobs artifacts
if: ${{ contains(github.event.inputs.os_list, 'windows') }}
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: ${{ steps.filename.outputs.WIN_MSI }}-msi name: ${{ steps.filename.outputs.WIN_MSI }}-msi
path: installers path: installers
- name: Download win exe installer jobs artifacts - name: Download win exe installer jobs artifacts
if: ${{ contains(github.event.inputs.os_list, 'windows') }}
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
name: ${{ steps.filename.outputs.WIN_EXE }}-exe name: ${{ steps.filename.outputs.WIN_EXE }}-exe
path: installers path: installers
- name: Rename Linux (modern) installer to nightlies
if: ${{ contains(github.event.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 MacOS (X64) installers to nightlies
if: ${{ contains(github.event.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(github.event.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 - name: Rename Windows installers to nightlies
if: ${{ contains(github.event.inputs.os_list, 'windows') }}
run: | run: |
mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi 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 mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe
- name: Update nightly release for Linux (modern)
if: ${{ contains(github.event.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 MacOS (X64)
if: ${{ contains(github.event.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(github.event.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 - name: Update nightly release for Windows
if: ${{ contains(github.event.inputs.os_list, 'windows') }}
run: | 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.msi --clobber
gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download MacOS (X64) dmg installer jobs artifacts
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
path: installers
- name: Download MacOS (X64) pkg installer jobs artifacts
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg
path: installers
- name: Rename MacOS (X64) installers to nightlies
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: Update nightly release for 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: Download MacOS (ARM-64) dmg installer jobs artifacts
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg
path: installers
- name: Download acOS (ARM-64) pkg installer jobs artifacts
uses: actions/download-artifact@v2
with:
name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg
path: installers
- name: Rename MacOS (ARM-64) installers to nightlies
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: Update nightly release for MacOS (ARM-64)
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 description (with date) - name: Update nightly release description (with date)
if: always()
run: | run: |
gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}" gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}"
env: env:

View file

@ -38,7 +38,7 @@ on:
type: choice type: choice
options: options:
- ubuntu-22.04 - ubuntu-22.04
- ubuntu-20.04
workflow_call: workflow_call:
inputs: inputs:
cura_conan_version: cura_conan_version:
@ -82,6 +82,7 @@ env:
jobs: jobs:
cura-installer-create: cura-installer-create:
timeout-minutes: 30
runs-on: ${{ inputs.operating_system }} runs-on: ${{ inputs.operating_system }}
steps: steps:

View file

@ -90,6 +90,7 @@ env:
jobs: jobs:
cura-installer-create: cura-installer-create:
timeout-minutes: 30
runs-on: ${{ inputs.operating_system }} runs-on: ${{ inputs.operating_system }}
outputs: outputs:

View file

@ -82,6 +82,7 @@ env:
jobs: jobs:
cura-installer-create: cura-installer-create:
timeout-minutes: 30
runs-on: ${{ inputs.operating_system }} runs-on: ${{ inputs.operating_system }}
outputs: outputs: