Use common script for installers

This commit is contained in:
Erwan MATHIEU 2024-11-29 11:40:29 +01:00
parent 55e2967551
commit 85c2d2f078
3 changed files with 15 additions and 99 deletions

View File

@ -7,91 +7,29 @@ on:
cura_conan_version: cura_conan_version:
description: 'Cura Conan Version' description: 'Cura Conan Version'
default: 'cura/[*]@ultimaker/testing' default: 'cura/[*]@ultimaker/testing'
required: true
type: string type: string
conan_args: conan_args:
description: 'Conan args, e.g. --requires' description: 'Conan args, e.g. --requires'
default: '' default: ''
required: false
type: string type: string
enterprise: enterprise:
description: 'Build Cura as an Enterprise edition' description: 'Build Cura as an Enterprise edition'
default: false default: false
required: true
type: boolean type: boolean
staging: staging:
description: 'Use staging API' description: 'Use staging API'
default: false 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 type: boolean
jobs: jobs:
windows-installer: installers:
# FIXME: Use main once merged # FIXME: Use main once merged
name: Create Windows installer name: Create installers
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-11622_conan_v2 uses: ultimaker/cura-workflows/.github/workflows/cura-installers.yml@CURA-11622_conan_v2
with: with:
cura_conan_version: ${{ inputs.cura_conan_version }} cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }} conan_args: ${{ inputs.conan_args }}
enterprise: ${{ inputs.enterprise == 'true' }} enterprise: ${{ inputs.enterprise == 'true' }}
staging: ${{ inputs.staging == '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:
# FIXME: Use main once merged
name: Create MacOS-ARM64 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: ARM64
operating_system: self-hosted-ARM64
secrets: inherit secrets: inherit

View File

@ -5,15 +5,12 @@ on:
workflow_call: workflow_call:
inputs: inputs:
cura_conan_version: cura_conan_version:
default: ''
required: true required: true
type: string type: string
release_tag: release_tag:
default: ''
required: true required: true
type: string type: string
caller_workflow: caller_workflow:
default: ''
required: true required: true
type: string type: string
@ -23,51 +20,31 @@ jobs:
name: Create installers name: Create installers
id: create-installers id: create-installers
# FIXME: Use main once merged # 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: with:
cura_conan_version: ${{ inputs.cura_conan_version }} cura_conan_version: ${{ inputs.cura_conan_version }}
secrets: inherit secrets: inherit
update-nightly-release: update-nightly-release:
name: Upload installers
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ create-installers ] needs: [ create-installers ]
steps: 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 - name: Download installers jobs artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
pattern: UltiMaker-Cura-*
path: installers path: installers
merge-multiple: true merge-multiple: true
- name: Rename the installers - name: Rename the installers
id: rename-installers id: rename-installers
shell: python
working-directory: installers working-directory: installers
run: | run: python ./Cura-workflows/runner_scripts/rename_installers.py --tag "nightly" >> $GITHUB_OUTPUT
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")
- name: create the release notes - name: create the release notes
shell: python shell: python
@ -92,11 +69,11 @@ jobs:
)) ))
- name: Update nightly release description and binaries - name: Update nightly release description and binaries
if: always() working-directory: installers
run: | run: |
gh release edit ${{ inputs.release_tag }} --title "${{ steps.rename-installers.outputs.cura_version }}" --notes-file release-notes.md 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 gh release upload ${{ inputs.release_tag }} $file --clobber
done done
env: env:

View File

@ -121,7 +121,8 @@ jobs:
create-installers: create-installers:
name: 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] needs: [parse-version, create-packages]
with: with:
cura_conan_version: cura/${{ inputs.cura_version }}@ultimaker/stable cura_conan_version: cura/${{ inputs.cura_version }}@ultimaker/stable