From 85c2d2f078a4e90bb64a4bfb7bbfbf8eabe5c9cd Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 29 Nov 2024 11:40:29 +0100 Subject: [PATCH] Use common script for installers --- .github/workflows/installers.yml | 68 +------------------ .github/workflows/nightly.yml | 43 +++--------- .../release-process_release-candidate.yml | 3 +- 3 files changed, 15 insertions(+), 99 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index e0ed6dbfe7a..f19af8a745a 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -7,91 +7,29 @@ on: cura_conan_version: description: 'Cura Conan Version' default: 'cura/[*]@ultimaker/testing' - required: true type: string conan_args: description: 'Conan args, e.g. --requires' default: '' - required: false type: string enterprise: description: 'Build Cura as an Enterprise edition' default: false - required: true type: boolean staging: description: 'Use staging API' default: false - required: true - type: boolean - - workflow_call: - inputs: - cura_conan_version: - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - default: '' - required: false - type: string - enterprise: - default: false - required: false - type: boolean - staging: - default: false - required: false type: boolean jobs: - windows-installer: -# FIXME: Use main once merged - name: Create Windows installer - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-11622_conan_v2 - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise == 'true' }} - staging: ${{ inputs.staging == 'true' }} - operating_system: self-hosted-Windows-X64 - secrets: inherit - -# FIXME: Use main once merged - linux-installer: - name: Create Linux AppImage - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@CURA-11622_conan_v2 - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise == 'true' }} - staging: ${{ inputs.staging == 'true' }} - operating_system: self-hosted-Ubuntu22-X64 - secrets: inherit - - macos-installer: -# FIXME: Use main once merged - name: Create MacOS-X64 packages - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-11622_conan_v2 - with: - cura_conan_version: ${{ inputs.cura_conan_version }} - conan_args: ${{ inputs.conan_args }} - enterprise: ${{ inputs.enterprise == 'true' }} - staging: ${{ inputs.staging == 'true' }} - architecture: X64 - operating_system: self-hosted-X64 - secrets: inherit - - macos-arm-installer: + installers: # FIXME: Use main once merged - name: Create MacOS-ARM64 packages - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-11622_conan_v2 + name: Create installers + uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@CURA-11622_conan_v2 with: cura_conan_version: ${{ inputs.cura_conan_version }} conan_args: ${{ inputs.conan_args }} enterprise: ${{ inputs.enterprise == 'true' }} staging: ${{ inputs.staging == 'true' }} - architecture: ARM64 - operating_system: self-hosted-ARM64 secrets: inherit diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d5fd0e98d2d..4b7403b7e94 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -5,15 +5,12 @@ on: workflow_call: inputs: cura_conan_version: - default: '' required: true type: string release_tag: - default: '' required: true type: string caller_workflow: - default: '' required: true type: string @@ -23,51 +20,31 @@ jobs: name: Create installers id: create-installers # FIXME: Use main once merged - uses: ultimaker/cura/github/workflows/installers.yml@CURA-11622_conan_v2 + uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@CURA-11622_conan_v2 with: cura_conan_version: ${{ inputs.cura_conan_version }} secrets: inherit update-nightly-release: + name: Upload installers runs-on: ubuntu-latest needs: [ create-installers ] steps: + - name: Setup the build environment +# FIXME: Use main once merged + uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@CURA-11622_conan_v2 + - name: Download installers jobs artifacts uses: actions/download-artifact@v4 with: + pattern: UltiMaker-Cura-* path: installers merge-multiple: true - name: Rename the installers id: rename-installers - shell: python working-directory: installers - run: | - import os - - first_file = True - - for file in os.listdir("."): - if file.startswith("UltiMaker-Cura-"): - # Find the commit tag, and replace it with "nightly" - index_plus = file.index("+") - file_start = file[:index_plus] - file_end = file[index_plus:] - file_end = file_end[file_end.index("-")+1:] - - new_file_name = f"{file_start}-nightly-{file_end}" - os.rename(file, new_file_name) - - if first_file: - first_file = False - - short_version = file_start.split("-")[2] - short_version = ".".join(short_version.split(".")[:2]) - - with open(os.environ["GITHUB_OUTPUT"], "a") as github_output: - github_output.write(f"cura_version={file_start}\n") - github_output.write(f"short_version={file_start}\n") - + run: python ./Cura-workflows/runner_scripts/rename_installers.py --tag "nightly" >> $GITHUB_OUTPUT - name: create the release notes shell: python @@ -92,11 +69,11 @@ jobs: )) - name: Update nightly release description and binaries - if: always() + working-directory: installers run: | gh release edit ${{ inputs.release_tag }} --title "${{ steps.rename-installers.outputs.cura_version }}" --notes-file release-notes.md - for file in "installers/*"; do + for file in "*"; do gh release upload ${{ inputs.release_tag }} $file --clobber done env: diff --git a/.github/workflows/release-process_release-candidate.yml b/.github/workflows/release-process_release-candidate.yml index ecd20449f60..caa132c8304 100644 --- a/.github/workflows/release-process_release-candidate.yml +++ b/.github/workflows/release-process_release-candidate.yml @@ -121,7 +121,8 @@ jobs: create-installers: name: Create installers - uses: ./.github/workflows/installers.yml +# FIXME: Use main once merged + uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@CURA-11622_conan_v2 needs: [parse-version, create-packages] with: cura_conan_version: cura/${{ inputs.cura_version }}@ultimaker/stable