From 0b6fc3d389ac7b25fe0fd4186c2ec50bff69295d Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:44:49 +0900 Subject: [PATCH] CI: Build with ubuntu-24.04 (#5919) * CI: Build with ubuntu-24.04 * Use apt-get in ubuntu-24.04 * Fix step name * Use alternate approach for detecting libwebkit2gtk version * CI: Install libfuse2 in ubuntu-24.04 * Reduce repetitive code in workflows Co-authored-by: Ocraftyone * CI: Install libfuse2 Runtime dependency for AppImage * Fix filenames for nightly deployment * Properly nest conditional --------- Co-authored-by: Ocraftyone --- .github/workflows/build_all.yml | 1 + .github/workflows/build_deps.yml | 24 ++++++++++++++------ .github/workflows/build_orca.yml | 39 ++++++++++++++++++++------------ linux.d/debian | 3 +-- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index c0e8ca12665..a21bb03c945 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -48,6 +48,7 @@ jobs: matrix: include: - os: ubuntu-20.04 + - os: ubuntu-24.04 - os: windows-latest - os: macos-14 arch: x86_64 diff --git a/.github/workflows/build_deps.yml b/.github/workflows/build_deps.yml index 3dc26aa51a8..a932cd76117 100644 --- a/.github/workflows/build_deps.yml +++ b/.github/workflows/build_deps.yml @@ -82,16 +82,24 @@ jobs: brew install zstd - - name: Build on Ubuntu - if: inputs.os == 'ubuntu-20.04' + - name: Install Ubuntu Build Dependencies + if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' working-directory: ${{ github.workspace }} + env: + apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }} + webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }} run: | - sudo apt-get update - sudo apt-get install -y cmake git g++ build-essential libgl1-mesa-dev m4 \ + ${{ env.apt-cmd }} update + ${{ env.apt-cmd }} install -y cmake git g++ build-essential libgl1-mesa-dev m4 \ libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules pkgconf \ - libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-4.0-dev \ + libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-${{ env.webkit-ver }}-dev \ libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev \ gstreamer1.0-plugins-bad libosmesa6-dev wget sudo autoconf curl libunwind-dev texinfo + + - name: Build on Ubuntu + if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' + working-directory: ${{ github.workspace }} + run: | mkdir -p ${{ github.workspace }}/deps/build mkdir -p ${{ github.workspace }}/deps/build/destdir sudo ./BuildLinux.sh -ur @@ -117,10 +125,12 @@ jobs: path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip - name: Upload Ubuntu artifacts - if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' }} + if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }} + env: + ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }} uses: actions/upload-artifact@v4 with: - name: OrcaSlicer_dep_ubuntu_${{ env.date }} + name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }} path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz build_orca: diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 727046687ee..d259079a351 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -221,32 +221,38 @@ jobs: # Ubuntu - name: Install dependencies - if: inputs.os == 'ubuntu-20.04' + if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' + env: + apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }} + webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }} + libfuse2-pkg: ${{ (inputs.os == 'ubuntu-20.04' && 'libfuse2') || (inputs.os == 'ubuntu-24.04' && 'libfuse2t64') || '' }} run: | - sudo apt-get update - sudo apt-get install -y autoconf build-essential cmake curl eglexternalplatform-dev \ + ${{ env.apt-cmd }} update + ${{ env.apt-cmd }} install -y autoconf build-essential cmake curl eglexternalplatform-dev \ extra-cmake-modules file git libcairo2-dev libcurl4-openssl-dev libdbus-1-dev libglew-dev libglu1-mesa-dev \ libglu1-mesa-dev libgstreamer1.0-dev libgstreamerd-3-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \ libgtk-3-dev libgtk-3-dev libmspack-dev libosmesa6-dev libsecret-1-dev libsoup2.4-dev libssl-dev libudev-dev libwayland-dev \ - libwebkit2gtk-4.0-dev libxkbcommon-dev locales locales-all m4 pkgconf sudo wayland-protocols wget + libwebkit2gtk-${{ env.webkit-ver }}-dev libxkbcommon-dev locales locales-all m4 pkgconf sudo wayland-protocols wget ${{ env.libfuse2-pkg }} - name: Install dependencies from BuildLinux.sh - if: inputs.os == 'ubuntu-20.04' + if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' shell: bash run: sudo ./BuildLinux.sh -ur - name: Fix permissions - if: inputs.os == 'ubuntu-20.04' + if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' shell: bash run: sudo chown $USER -R ./ - name: Build slicer - if: inputs.os == 'ubuntu-20.04' + if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' shell: bash + env: + ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }} run: | ./BuildLinux.sh -isr - mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage - chmod +x ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage + mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage + chmod +x ./build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage - name: Build orca_custom_preset_tests if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' @@ -258,19 +264,24 @@ jobs: zip -r orca_custom_preset_tests.zip user/ - name: Upload artifacts Ubuntu - if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' }} + if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }} + env: + ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }} + ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }} uses: actions/upload-artifact@v4 with: - name: OrcaSlicer_Linux_${{ env.ver }} - path: './build/OrcaSlicer_Linux_${{ env.ver }}.AppImage' + name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }} + path: './build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage' - name: Deploy Ubuntu release - if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' }} + if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }} + env: + ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }} uses: WebFreak001/deploy-nightly@v3.1.0 with: upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} release_id: 137995723 - asset_path: ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage + asset_path: ./build/OrcaSlicer_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage asset_name: OrcaSlicer_Linux_${{ env.ver }}.AppImage asset_content_type: application/octet-stream max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted diff --git a/linux.d/debian b/linux.d/debian index e58a6ec55d1..796f2ab1005 100644 --- a/linux.d/debian +++ b/linux.d/debian @@ -39,8 +39,7 @@ then fi # check which version of libwebkit2gtk is available - apt show --quiet libwebkit2gtk-4.0-dev >/dev/null 2>&1 - if [ "$?" == "0" ] + if [ "$(apt show --quiet libwebkit2gtk-4.0-dev)" != "" ] then REQUIRED_DEV_PACKAGES+=(libwebkit2gtk-4.0-dev) else