Skip to content

Commit

Permalink
Use common script for installers
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 29, 2024
1 parent 55e2967 commit 85c2d2f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 99 deletions.
68 changes: 3 additions & 65 deletions .github/workflows/installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
43 changes: 10 additions & 33 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-process_release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85c2d2f

Please sign in to comment.