diff --git a/.github/workflows/conan-package-create-linux.yml b/.github/workflows/conan-package-create-linux.yml index 247a3266..b4d2b749 100644 --- a/.github/workflows/conan-package-create-linux.yml +++ b/.github/workflows/conan-package-create-linux.yml @@ -33,6 +33,11 @@ on: default: "" type: string + conan_recipe_root: + required: false + default: "." + type: string + permissions: contents: read @@ -110,7 +115,7 @@ jobs: ${{ runner.os }}-conan- - name: Create the Package (binaries) - run: conan create . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} + run: conan create ${{ inputs.conan_recipe_root }} --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} - name: Upload the Package(s) if: ${{ always() && !inputs.conan_internal }} diff --git a/.github/workflows/conan-package-create-macos.yml b/.github/workflows/conan-package-create-macos.yml index 0b67064a..435c2944 100644 --- a/.github/workflows/conan-package-create-macos.yml +++ b/.github/workflows/conan-package-create-macos.yml @@ -33,6 +33,11 @@ on: default: "" type: string + conan_recipe_root: + required: false + default: "." + type: string + permissions: contents: read @@ -43,7 +48,7 @@ env: jobs: package-create: - runs-on: macos-11 + runs-on: macos-12 steps: - name: Checkout repo @@ -110,7 +115,7 @@ jobs: ${{ runner.os }}-conan- - name: Create the Package (binaries) - run: conan create . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} + run: conan create ${{ inputs.conan_recipe_root }} --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} - name: Upload the Package(s) if: ${{ always() && !inputs.conan_internal }} diff --git a/.github/workflows/conan-package-create-wasm.yml b/.github/workflows/conan-package-create-wasm.yml new file mode 100644 index 00000000..9720e1ed --- /dev/null +++ b/.github/workflows/conan-package-create-wasm.yml @@ -0,0 +1,112 @@ +name: Conan package create Wasm + +on: + workflow_call: + inputs: + recipe_id_full: + required: true + type: string + + conan_internal: + required: false + default: false + type: boolean + + conan_extra_args: + required: false + default: "" + type: string + + conan_recipe_root: + required: false + default: "." + type: string + +permissions: + contents: read + +env: + CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} + CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} + SENTRY_TOKEN: ${{ secrets.CURAENGINE_SENTRY_TOKEN }} + +jobs: + package-create: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + with: + fetch-depth: 1 + ref: ${{ github.head_ref }} + + - name: Checkout repo PR + uses: actions/checkout@v4 + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + with: + fetch-depth: 1 + ref: ${{ github.base_ref }} + + - name: Sync pip requirements + run: wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt -O .github/workflows/requirements-runner.txt + + - name: Setup Python and pip + uses: actions/setup-python@v4 + with: + python-version: 3.11.x + cache: pip + cache-dependency-path: .github/workflows/requirements-runner.txt + + - name: Install Python requirements and Create default Conan profile + run: pip install -r .github/workflows/requirements-runner.txt + + - name: Install Linux system requirements for building + run: | + mkdir -p runner_scripts + wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh -O runner_scripts/ubuntu_setup.sh + chmod +x runner_scripts/ubuntu_setup.sh + sudo ./runner_scripts/ubuntu_setup.sh + + - name: Setup pipeline caches + run: | + mkdir -p /home/runner/.conan/downloads + + - name: Create default Conan profile + run: conan profile new default --detect + + - name: Get Conan configuration + run: | + conan config install https://github.com/Ultimaker/conan-config.git + conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" + + - name: Add runner credentials to cura remote + run: conan user -p ${{ secrets.CONAN_PASS }} -r cura ${{ secrets.CONAN_USER }} + + - name: Add Cura private Artifactory remote + if: ${{ inputs.conan_internal }} + run: | + conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/internal" + conan user -p ${{ secrets.CONAN_PASS }} -r cura-private ${{ secrets.CONAN_USER }} + + - name: Cache Conan downloads + uses: actions/cache@v3 + with: + path: /home/runner/.conan/downloads + key: ${{ runner.os }}-conan-downloads-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-conan-downloads- + + - name: Export the Package (binaries) + run: conan create ${{ inputs.conan_recipe_root }} ${{ inputs.recipe_id_full }} --build=missing --update ${{ inputs.conan_extra_args }} -pr:h cura_wasm.jinja + + - name: Upload the Package(s) + if: ${{ always() && !inputs.conan_internal }} + run: | + conan upload ${{ inputs.recipe_id_full }} -r cura --all -c + + - name: Upload the Package(s) to the private Artifactory + if: ${{ always() && inputs.conan_internal }} + run: | + conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c diff --git a/.github/workflows/conan-package-create-windows.yml b/.github/workflows/conan-package-create-windows.yml index 177784fb..5949effd 100644 --- a/.github/workflows/conan-package-create-windows.yml +++ b/.github/workflows/conan-package-create-windows.yml @@ -33,6 +33,11 @@ on: default: "" type: string + conan_recipe_root: + required: false + default: "." + type: string + permissions: contents: read @@ -104,7 +109,7 @@ jobs: ${{ runner.os }}-conan- - name: Create the Package (binaries) - run: conan create . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} + run: conan create ${{ inputs.conan_recipe_root }} --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} - name: Upload the Package(s) if: ${{ always() && !inputs.conan_internal }} diff --git a/.github/workflows/conan-package-release.yml b/.github/workflows/conan-package-release.yml index 5f77ded4..3005fbbf 100644 --- a/.github/workflows/conan-package-release.yml +++ b/.github/workflows/conan-package-release.yml @@ -47,16 +47,10 @@ on: default: true type: boolean - conan_user: - description: 'Conan user (_, ultimaker, internal)' + conan_user_channel: + description: 'Conan user and channel (_/_, ultimaker/testing, internal/testings)' required: false - default: '_' - type: string - - conan_channel: - description: 'Conan channel (_, testing, stable)' - required: false - default: '_' + default: '_/_' type: string conan_internal: @@ -77,6 +71,12 @@ on: default: '' type: string + conan_recipe_root: + required: false + default: "." + description: 'location of the conanfile.py defaults to `.`' + type: string + workflow_call: inputs: organization: @@ -97,14 +97,14 @@ on: required: true type: string - conan_user: + conan_release: required: false - default: '_' - type: string + default: true + type: boolean - conan_channel: + conan_user_channel: required: false - default: '_' + default: '_/_' type: string conan_internal: @@ -122,16 +122,22 @@ on: default: '' type: string + conan_recipe_root: + required: false + default: "." + type: string + permissions: contents: read env: CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} + SENTRY_TOKEN: ${{ secrets.CURAENGINE_SENTRY_TOKEN }} jobs: package-export: - runs-on: ubuntu-latest + runs-on: self-hosted-Ubuntu22-X64 steps: - name: Checkout repo @@ -163,7 +169,7 @@ jobs: mkdir -p /home/runner/.conan/downloads - name: Create default Conan profile - run: conan profile new default --detect + run: conan profile new default --detect --force - name: Get Conan configuration run: | @@ -187,17 +193,30 @@ jobs: - name: Get basic project info run: | - echo "CONAN_PROJECT_NAME=$(conan inspect . | awk '/^name:/ {print $2}')" >> $GITHUB_ENV + echo "CONAN_PROJECT_NAME=$(conan inspect ${{ inputs.conan_recipe_root }} | awk '/^name:/ {print $2}')" >> $GITHUB_ENV - id: get-conan-broadcast-data name: Get Conan broadcast data run: | mkdir runner_scripts wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/get_conan_broadcast_data.py -O runner_scripts/get_conan_broadcast_data.py - python runner_scripts/get_conan_broadcast_data.py --user ${{ inputs.conan_user }} --channel ${{ inputs.conan_channel }} --project_name $CONAN_PROJECT_NAME --release ${{ inputs.conan_release }} --version ${{ inputs.version }} + python runner_scripts/get_conan_broadcast_data.py --user_channel ${{ inputs.conan_user_channel }} --project_name $CONAN_PROJECT_NAME --release ${{ inputs.conan_release }} --version ${{ inputs.version }} + + - name: Install system requirements for building + run: | + mkdir -p runner_scripts + wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh -O runner_scripts/ubuntu_setup.sh + chmod +x runner_scripts/ubuntu_setup.sh + sudo ./runner_scripts/ubuntu_setup.sh + + - id: export-package + name: Export the Package + if: ${{ inputs.conan_recipe_root != '.' || (inputs.repository != 'Cura' && inputs.repository!='Uranium') }} + run: conan export ${{ inputs.conan_recipe_root }} ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }} - - name: Export the Package - run: conan export . ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }} + - name: Create conan for Uranium and Cura + if: ${{ steps.export-package.conclusion == 'skipped' }} + run: conan create . ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }} --build=missing --update -o cura:devtools=True -o *:enable_i18n=True -c user.i18n:options="{'extract':True,'build':True}" - name: Create the latest alias if: ${{ inputs.conan_latest }} @@ -217,4 +236,4 @@ jobs: - name: Upload the latest Package(s) to the private Artifactory if: ${{ inputs.conan_internal && inputs.conan_latest }} - run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} -r cura-private -c \ No newline at end of file + run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} -r cura-private -c diff --git a/.github/workflows/conan-recipe-export.yml b/.github/workflows/conan-recipe-export.yml index 5a9348c1..ae6a6984 100644 --- a/.github/workflows/conan-recipe-export.yml +++ b/.github/workflows/conan-recipe-export.yml @@ -33,6 +33,11 @@ on: default: "" type: string + conan_recipe_root: + required: false + default: "." + type: string + permissions: contents: read @@ -91,7 +96,7 @@ jobs: conan remote login cura-private-conan2 ${{ secrets.CONAN_USER }} -p ${{ secrets.CONAN_PASS }} - name: Export the Package - run: conan export . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} + run: conan export ${{ inputs.conan_recipe_root }} --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} - name: Upload the Package(s) if: ${{ !inputs.conan_internal}} diff --git a/.github/workflows/conan-recipe-version.yml b/.github/workflows/conan-recipe-version.yml index 8a8312d6..8780ebea 100644 --- a/.github/workflows/conan-recipe-version.yml +++ b/.github/workflows/conan-recipe-version.yml @@ -81,6 +81,14 @@ jobs: sparse-checkout: 'conandata.yml' ref: ${{ github.base_ref }} + - name: Checkout Cura-workflows repo + uses: actions/checkout@v4 + with: + repository: Ultimaker/Cura-workflows +# FIXME: use main once merged + ref: CURA-11622_conan_v2 + path: Cura-workflows + - name: Setup Python and pip uses: actions/setup-python@v4 with: @@ -93,6 +101,4 @@ jobs: - id: get-conan-broadcast-data name: Get Conan broadcast data run: | - mkdir runner_scripts - wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/CURA-11622_conan_v2/runner_scripts/get_conan_broadcast_data.py -O runner_scripts/get_conan_broadcast_data.py - python runner_scripts/get_conan_broadcast_data.py --user ${{ inputs.user }} --project_name "${{ inputs.project_name }}" --sha "${{ github.sha }}" --event_name "${{ github.event_name }}" --base_ref "${{ github.base_ref }}" --ref_name "${{ github.ref_name }}" --release "${{ inputs.release }}" --version "${{ inputs.version }}" \ No newline at end of file + python Cura-workflows/runner_scripts/get_conan_broadcast_data.py --user ${{ inputs.user }} --project_name "${{ inputs.project_name }}" --sha "${{ github.sha }}" --event_name "${{ github.event_name }}" --ref_name "${{ github.ref_name }}" --head_ref "${{ github.head_ref }}" --release "${{ inputs.release }}" --version "${{ inputs.version }}" diff --git a/.github/workflows/cura-installer-linux.yml b/.github/workflows/cura-installer-linux.yml index 3cbccd9f..9631d264 100644 --- a/.github/workflows/cura-installer-linux.yml +++ b/.github/workflows/cura-installer-linux.yml @@ -62,42 +62,43 @@ jobs: runs-on: ${{ inputs.operating_system }} steps: - - name: Checkout + - name: Checkout Cura repo uses: actions/checkout@v4 with: - fetch-depth: 1 + repository: Ultimaker/Cura - - name: Sync pip requirements - run: wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt -O .github/workflows/requirements-runner.txt + - name: Checkout Cura-workflows repo + uses: actions/checkout@v4 + with: + repository: Ultimaker/Cura-workflows + path: Cura-workflows - name: Setup Python and pip - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.1.0 with: python-version: 3.11.x cache: pip - cache-dependency-path: .github/workflows/requirements-runner.txt + cache-dependency-path: Cura-workflows/.github/workflows/requirements-runner.txt - name: Install Python requirements and Create default Conan profile - run: pip install -r .github/workflows/requirements-runner.txt + run: pip install -r Cura-workflows/.github/workflows/requirements-runner.txt - name: Install Linux system requirements for building + working-directory: Cura-workflows/runner_scripts run: | - mkdir runner_scripts - cd runner_scripts - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh chmod +x ubuntu_setup.sh sudo ./ubuntu_setup.sh - - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/appimage_setup.sh - cd .. - source ./runner_scripts/appimage_setup.sh - - name: Setup pipeline caches + - name: Install AppImage builder run: | - mkdir -p /home/runner/.conan/downloads + chmod +x ./Cura-workflows/runner_scripts/appimage_setup.sh + ./Cura-workflows/runner_scripts/appimage_setup.sh + + - name: Setup pipeline caches + run: mkdir -p /home/runner/.conan/downloads - name: Create default Conan profile - run: conan profile new default --detect + run: conan profile new default --detect --force - name: Get Conan configuration run: | @@ -135,18 +136,12 @@ jobs: - name: Create the Cura dist run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - name: Get installer helper scripts - run: | - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/cura_installer_filename.py - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/summarize_used_dependencies.py - working-directory: runner_scripts - - name: Output the name file name and extension id: filename - run: python runner_scripts/cura_installer_filename.py --os ${{ runner.os }} --arch ${{ inputs.architecture }} --enterprise ${{ inputs.enterprise }} --internal ${{ inputs.conan_internal }} + run: python Cura-workflows/runner_scripts/cura_installer_filename.py --os ${{ runner.os }} --arch ${{ inputs.architecture }} --enterprise ${{ inputs.enterprise }} --internal ${{ inputs.conan_internal }} - name: Summarize the used dependencies - run: python runner_scripts/summarize_used_dependencies.py --installer_filename ${{ steps.filename.outputs.INSTALLER_FILENAME }} + run: python Cura-workflows/runner_scripts/summarize_used_dependencies.py --installer_filename ${{ steps.filename.outputs.INSTALLER_FILENAME }} - name: Create the Linux AppImage (Bash) run: | @@ -170,7 +165,7 @@ jobs: run: conan upload "*" -r cura --all -c - name: Upload the AppImage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-AppImage path: | @@ -178,7 +173,7 @@ jobs: retention-days: 5 - name: Upload the asc - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-asc path: | @@ -193,7 +188,7 @@ jobs: f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - name: Upload the run info - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: linux-run-info path: | diff --git a/.github/workflows/cura-installer-macos.yml b/.github/workflows/cura-installer-macos.yml index a10ab189..8f4a0c18 100644 --- a/.github/workflows/cura-installer-macos.yml +++ b/.github/workflows/cura-installer-macos.yml @@ -68,39 +68,30 @@ jobs: runs-on: ${{ inputs.operating_system }} steps: - - name: Checkout repo + - name: Checkout Cura repo uses: actions/checkout@v4 - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} with: - fetch-depth: 1 - ref: ${{ github.head_ref }} + repository: Ultimaker/Cura - - name: Checkout repo PR + - name: Checkout Cura-workflows repo uses: actions/checkout@v4 - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} with: - fetch-depth: 1 - ref: ${{ github.base_ref }} - - - name: Sync pip requirements - run: curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt - working-directory: .github/workflows + repository: Ultimaker/Cura-workflows + path: Cura-workflows - name: Setup Python and pip uses: actions/setup-python@v4 with: python-version: 3.11.x cache: pip - cache-dependency-path: .github/workflows/requirements-runner.txt + cache-dependency-path: Cura-workflows/.github/workflows/requirements-runner.txt - name: Install Python requirements and Create default Conan profile - run: pip install -r .github/workflows/requirements-runner.txt + run: pip install -r Cura-workflows/.github/workflows/requirements-runner.txt - name: Install Macos system requirements for building + working-directory: Cura-workflows/runner_scripts run: | - mkdir runner_scripts - cd runner_scripts - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/macos_setup.sh chmod +x macos_setup.sh ./macos_setup.sh @@ -173,18 +164,12 @@ jobs: - name: Create the Cura dist run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - name: Get installer helper scripts - run: | - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/cura_installer_filename.py - curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/summarize_used_dependencies.py - working-directory: runner_scripts - - - name: Output the name file name and extension + - name: Output the file name and extension id: filename - run: python runner_scripts/cura_installer_filename.py --os ${{ runner.os }} --arch ${{ inputs.architecture }} --enterprise ${{ inputs.enterprise }} --internal ${{ inputs.conan_internal }} + run: python Cura-workflows/runner_scripts/cura_installer_filename.py --os ${{ runner.os }} --arch ${{ inputs.architecture }} --enterprise ${{ inputs.enterprise }} --internal ${{ inputs.conan_internal }} - name: Summarize the used dependencies - run: python runner_scripts/summarize_used_dependencies.py --installer_filename ${{ steps.filename.outputs.INSTALLER_FILENAME }} + run: python Cura-workflows/runner_scripts/summarize_used_dependencies.py --installer_filename ${{ steps.filename.outputs.INSTALLER_FILENAME }} - name: Create the Macos dmg (Bash) run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ steps.filename.outputs.INSTALLER_FILENAME }}" --build_dmg --build_pkg --app_name "$CURA_APP_NAME" @@ -200,7 +185,7 @@ jobs: run: conan upload "*" -r cura --all -c - name: Upload the dmg - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-dmg path: | @@ -208,7 +193,7 @@ jobs: retention-days: 5 - name: Upload the pkg - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-pkg path: | @@ -223,9 +208,9 @@ jobs: f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - name: Upload the run info - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: - name: macos-run-info + name: macos-run-info-${{ inputs.architecture }} path: | run_info.sh retention-days: 5 diff --git a/.github/workflows/cura-installer-windows.yml b/.github/workflows/cura-installer-windows.yml index d779a454..3235da08 100644 --- a/.github/workflows/cura-installer-windows.yml +++ b/.github/workflows/cura-installer-windows.yml @@ -63,33 +63,26 @@ jobs: runs-on: ${{ inputs.operating_system }} steps: - - name: Checkout repo + - name: Checkout Cura repo uses: actions/checkout@v4 - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} with: - fetch-depth: 1 - ref: ${{ github.head_ref }} + repository: Ultimaker/Cura - - name: Checkout repo PR + - name: Checkout Cura-workflows repo uses: actions/checkout@v4 - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} with: - fetch-depth: 1 - ref: ${{ github.base_ref }} - - - name: Sync pip requirements - run: curl.exe -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt - working-directory: .github\workflows + repository: Ultimaker/Cura-workflows + path: Cura-workflows - name: Setup Python and pip uses: actions/setup-python@v4 with: python-version: 3.11.x cache: pip - cache-dependency-path: .\.github\workflows\requirements-runner.txt + cache-dependency-path: .\Cura-workflows\.github\workflows\requirements-runner.txt - name: Install Python requirements and Create default Conan profile - run: pip install -r .\.github\workflows\requirements-runner.txt + run: pip install -r .\Cura-workflows\.github\workflows\requirements-runner.txt - name: Create default Conan profile run: conan profile new default --detect --force @@ -120,19 +113,12 @@ jobs: - name: Create the Cura dist run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - name: Get installer helper scripts - run: | - New-Item -ItemType Directory -Force -Path runner_scripts - cd runner_scripts - curl.exe -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/cura_installer_filename.py - curl.exe -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/summarize_used_dependencies.py - - name: Output the name file name and extension id: filename - run: python runner_scripts/cura_installer_filename.py --os ${{ runner.os }} --arch ${{ inputs.architecture }} --enterprise ${{ inputs.enterprise }} --internal ${{ inputs.conan_internal }} + run: python Cura-workflows/runner_scripts/cura_installer_filename.py --os ${{ runner.os }} --arch ${{ inputs.architecture }} --enterprise ${{ inputs.enterprise }} --internal ${{ inputs.conan_internal }} - name: Summarize the used dependencies - run: python runner_scripts/summarize_used_dependencies.py --installer_filename ${{ steps.filename.outputs.INSTALLER_FILENAME }} + run: python Cura-workflows/runner_scripts/summarize_used_dependencies.py --installer_filename ${{ steps.filename.outputs.INSTALLER_FILENAME }} - name: Create the Windows msi installer (Powershell) run: | @@ -141,7 +127,7 @@ jobs: - name: Sign the Windows msi installer (Powershell) run: | - & signtool sign /v /fd sha256 /tr http://timestamp.digicert.com /td sha256 /f C:\actions-runner\code_sign.cer /csp "eToken Base Cryptographic Provider" /kc ${{ secrets.WIN_TOKEN_CONTAINER }} "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" + & signtool sign /v /fd sha256 /tr http://timestamp.sectigo.com /td sha256 /f C:\actions-runner\code_sign.cer /csp "eToken Base Cryptographic Provider" /kc ${{ secrets.WIN_TOKEN_CONTAINER }} "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" working-directory: dist timeout-minutes: 2 @@ -154,7 +140,7 @@ jobs: - name: Sign the Windows exe installer (Powershell) if: ${{ always() }} run: | - & signtool sign /v /fd sha256 /tr http://timestamp.digicert.com /td sha256 /f C:\actions-runner\code_sign.cer /csp "eToken Base Cryptographic Provider" /kc ${{ secrets.WIN_TOKEN_CONTAINER }} "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" + & signtool sign /v /fd sha256 /tr http://timestamp.sectigo.com /td sha256 /f C:\actions-runner\code_sign.cer /csp "eToken Base Cryptographic Provider" /kc ${{ secrets.WIN_TOKEN_CONTAINER }} "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" working-directory: dist timeout-minutes: 2 @@ -164,28 +150,44 @@ jobs: conan remove "*@internal/*" -f conan remove "cura_private_data*" -f - - name: Upload the Package(s) - if: ${{ always() && ! inputs.conan_internal }} - run: conan upload "*" -r cura --all -c +# - name: Upload the Package(s) +# if: ${{ always() && ! inputs.conan_internal }} +# run: conan upload "*" -r cura --all -c - - name: Upload the msi + - name: Upload the installer msi if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-msi path: | dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.msi retention-days: 5 - - name: Upload the exe + - name: Upload the installer exe if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-exe path: | dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.exe retention-days: 5 + - name: Upload the application exe + if: ${{ always() }} + uses: actions/upload-artifact@v4.3.3 + with: + name: UltiMaker-Cura.exe + path: dist/UltiMaker-Cura/UltiMaker-Cura.exe + retention-days: 5 + + - name: Upload the engine exe + if: ${{ always() }} + uses: actions/upload-artifact@v4.3.3 + with: + name: CuraEngine.exe + path: dist/UltiMaker-Cura/CuraEngine.exe + retention-days: 5 + # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - name: Write the run info if: ${{ always() }} @@ -198,7 +200,7 @@ jobs: # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - name: Upload the run info if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.3.3 with: name: windows-run-info path: | diff --git a/.github/workflows/cura-set-packages-versions.yml b/.github/workflows/cura-set-packages-versions.yml new file mode 100644 index 00000000..28dea88b --- /dev/null +++ b/.github/workflows/cura-set-packages-versions.yml @@ -0,0 +1,69 @@ +name: Freeze Cura packages version +run-name: Freeze Cura packages version to ${{ inputs.version }} + +on: + workflow_call: + inputs: + cura_version: + required: true + type: string + + create_feature_branch: + required: true + type: boolean + +jobs: + parse-version: + name: Parse input version string + runs-on: ubuntu-latest + outputs: + branch_name: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }} + steps: + - name: Parse version string + id: version_parser + uses: booxmedialtd/ws-action-parse-semver@v1.4.7 + with: + input_string: ${{ inputs.cura_version }} + + freeze-packages-versions: + name: Freeze packages versions + runs-on: ubuntu-latest + needs: [parse-version] + strategy: + matrix: + repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials] + include: + - main_branch: ${{ inputs.create_feature_branch && 'main' || needs.parse-version.outputs.branch_name }} + - repository: fdm_materials + main_branch: ${{ inputs.create_feature_branch && 'master' || needs.parse-version.outputs.branch_name }} + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + repository: Ultimaker/${{ matrix.repository }} + ref: ${{ matrix.main_branch }} + token: ${{ secrets.CURA_AUTORELEASE_PAT }} + + - name: Update conan packages versions + run: | + PACKAGE_VERSION=${{ inputs.cura_version }} + sed -i "s/version:.*/version: \"$PACKAGE_VERSION\"/g" conandata.yml + sed -i "s/\"uranium\/.*/\"uranium\/$PACKAGE_VERSION\"/g" conandata.yml + sed -i "s/\"cura_resources\/.*/\"cura_resources\/$PACKAGE_VERSION\"/g" conandata.yml + sed -i "s/\"curaengine\/.*/\"curaengine\/$PACKAGE_VERSION\"/g" conandata.yml + sed -i "s/\"cura_binary_data\/.*/\"cura_binary_data\/$PACKAGE_VERSION\"/g" conandata.yml + sed -i "s/\"fdm_materials\/.*/\"fdm_materials\/$PACKAGE_VERSION\"/g" conandata.yml + + - name: Update resources conan package version + if: ${{ matrix.repository == 'Cura' }} + working-directory: resources + run: | + PACKAGE_VERSION=${{ inputs.cura_version }} + sed -i "s/version:.*/version: \"$PACKAGE_VERSION\"/g" conandata.yml + + - name: Create branch and commit + uses: stefanzweifel/git-auto-commit-action@v5.0.1 + with: + commit_message: Set conan package version ${{ inputs.cura_version }} + branch: ${{ needs.parse-version.outputs.branch_name }} + create_branch: true diff --git a/.github/workflows/requirements-runner.txt b/.github/workflows/requirements-runner.txt index 45064d3f..93f5b566 100644 --- a/.github/workflows/requirements-runner.txt +++ b/.github/workflows/requirements-runner.txt @@ -1,3 +1,3 @@ -conan>=2.0.0 +conan>=2.7.0 sip>=6.8.1 -sentry-cli==2.21.2 \ No newline at end of file +sentry-cli==2.21.2 diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml index a286c723..64859a3b 100644 --- a/.github/workflows/unit-test-post.yml +++ b/.github/workflows/unit-test-post.yml @@ -12,7 +12,9 @@ on: type: string permissions: + contents: read issues: write + checks: write pull-requests: write env: @@ -92,6 +94,7 @@ jobs: id: test-results uses: EnricoMi/publish-unit-test-result-action@v2 with: + github-token: ${{ secrets.CURA_UNIT_TESTS_POST_PAT }} files: "tests/**/*.xml" - name: Conclusion diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 86a8086e..dc9bfa64 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -42,7 +42,6 @@ permissions: env: CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} - SENTRY_TOKEN: ${{ secrets.CURAENGINE_SENTRY_TOKEN }} jobs: testing: @@ -95,9 +94,6 @@ jobs: conan config install https://github.com/Ultimaker/conan-config.git conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - name: Add runner credentials to cura remote - run: conan user -p ${{ secrets.CONAN_PASS }} -r cura ${{ secrets.CONAN_USER }} - - name: Add Cura private Artifactory remote if: ${{ inputs.conan_internal }} run: | diff --git a/runner_scripts/get_conan_broadcast_data.py b/runner_scripts/get_conan_broadcast_data.py index f2fa882a..84f9e2b7 100644 --- a/runner_scripts/get_conan_broadcast_data.py +++ b/runner_scripts/get_conan_broadcast_data.py @@ -21,10 +21,10 @@ def get_conan_broadcast_data(args): actual_version = version user = args.user.lower() is_release_branch = False - if args.channel: - channel = args.channel.lower() + if args.channel or args.user_channel: + channel = args.channel.lower() if args.channel else args.user_channel.split("/")[1].lower() else: - ref_name = args.base_ref if args.event_name == "pull_request" else args.ref_name + ref_name = args.head_ref if args.event_name == "pull_request" else args.ref_name if "beta" in version and args.event_name != "pull_request" and ref_name == '.'.join(version.split('.')[:2]): channel = "stable" is_release_branch = True @@ -63,11 +63,12 @@ def get_conan_broadcast_data(args): parser = argparse.ArgumentParser(description = 'Get Conan broadcast data') parser.add_argument('--user', type = str, help = 'User input') parser.add_argument('--channel', type = str, help = 'User channel') + parser.add_argument('--user_channel', type = str, help = 'User and Channel in format `user/channel` ') parser.add_argument('--project_name', type = str, help = 'Name of the project') parser.add_argument('--sha', type = str, help = 'Commit SHA') parser.add_argument('--event_name', type = str, help = 'Github event name') - parser.add_argument('--base_ref', type = str, help = 'Github base reference') parser.add_argument('--ref_name', type = str, help = 'Github name reference') + parser.add_argument('--head_ref', type = str, help = 'Github source branch name') parser.add_argument('--release', type = str, help = 'Is a release') parser.add_argument('--version', type = str, help = 'User override version') diff --git a/runner_scripts/ubuntu_setup.sh b/runner_scripts/ubuntu_setup.sh index a21225af..2f2e099e 100644 --- a/runner_scripts/ubuntu_setup.sh +++ b/runner_scripts/ubuntu_setup.sh @@ -1,9 +1,11 @@ #!/bin/bash +apt remove firefox + add-apt-repository ppa:ubuntu-toolchain-r/test -y apt update -apt upgrade -apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev libxcb-cursor-dev pkg-config flex bison -y +apt upgrade -y +apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-dri2-0-dev libxcb-present-dev libxcb-composite0-dev libxcb-ewmh-dev libxcb-res0-dev pkg-config flex bison libfreetype-dev patchelf -y apt install g++-13 gcc-13 -y update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13