diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 80e48691eae..4ccd6c13403 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,6 +12,9 @@ "features": { "ghcr.io/devcontainers/features/desktop-lite:1": { "password": "orca" + }, + "windows/arm64": { + "password": "orca" } }, "customizations": { diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index c0990561e14..5f988694b7a 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -1,124 +1,127 @@ -name: Build all - -on: - push: - branches: - - main - - release/* - paths: - - 'deps/**' - - 'src/**' - - '**/CMakeLists.txt' - - 'version.inc' - - 'localization/**' - - 'resources/**' - - ".github/workflows/build_*.yml" - - 'flatpak/**' - - pull_request: - branches: - - main - - release/* - paths: - - 'deps/**' - - 'src/**' - - '**/CMakeLists.txt' - - 'version.inc' - - ".github/workflows/build_*.yml" - - 'BuildLinux.sh' - - 'build_release_vs2022.bat' - - 'build_release_macos.sh' - - 'flatpak/**' - - workflow_dispatch: # allows for manual dispatch - inputs: - build-deps-only: - description: 'Only build dependencies (bypasses caching)' - type: boolean - default: false - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - - -jobs: - build_all: - name: Build All - strategy: - fail-fast: false - matrix: - include: - # Deprecate 20.04appimage - # - os: ubuntu-20.04 - - os: ubuntu-24.04 - - os: windows-latest - - os: macos-14 - arch: arm64 - uses: ./.github/workflows/build_check_cache.yml - with: - os: ${{ matrix.os }} - arch: ${{ matrix.arch }} - build-deps-only: ${{ inputs.build-deps-only || false }} - secrets: inherit - flatpak: - name: "Flatpak" - container: - image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-46 - options: --privileged - volumes: - - /usr/local/lib/android:/usr/local/lib/android - - /usr/share/dotnet:/usr/share/dotnet - - /opt/ghc:/opt/ghc1 - - /usr/local/share/boost:/usr/local/share/boost1 - strategy: - matrix: - variant: - - arch: x86_64 - runner: ubuntu-24.04 - - arch: aarch64 - runner: ubuntu-24.04-arm - runs-on: ${{ matrix.variant.runner }} - env: - date: - ver: - ver_pure: - steps: - - name: "Remove unneeded stuff to free disk space" - run: - rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" - - uses: actions/checkout@v4 - - name: Get the version and date - run: | - ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2) - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - ver="PR-${{ github.event.number }}" - else - ver=V$ver_pure - fi - echo "ver=$ver" >> $GITHUB_ENV - echo "ver_pure=$ver_pure" >> $GITHUB_ENV - echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV - shell: bash - - uses: flathub-infra/flatpak-github-actions/flatpak-builder@master - with: - bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak - manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml - cache: true - arch: ${{ matrix.variant.arch }} - upload-artifact: false - - name: Upload artifacts Flatpak - uses: actions/upload-artifact@v4 - with: - name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak - path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak' - - name: Deploy Flatpak to nightly release - if: ${{github.ref == 'refs/heads/main'}} - uses: WebFreak001/deploy-nightly@v3.2.0 - with: - upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} - release_id: 137995723 - asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak - asset_name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak - 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 +name: Build all + +on: + push: + branches: + - main + - release/* + paths: + - 'deps/**' + - 'src/**' + - '**/CMakeLists.txt' + - 'version.inc' + - 'localization/**' + - 'resources/**' + - ".github/workflows/build_*.yml" + - 'flatpak/**' + + pull_request: + branches: + - main + - release/* + paths: + - 'deps/**' + - 'src/**' + - '**/CMakeLists.txt' + - 'version.inc' + - ".github/workflows/build_*.yml" + - 'BuildLinux.sh' + - 'build_release_vs2022.bat' + - 'build_release_macos.sh' + - 'flatpak/**' + + workflow_dispatch: # allows for manual dispatch + inputs: + build-deps-only: + description: 'Only build dependencies (bypasses caching)' + type: boolean + default: false + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + +jobs: + build_all: + name: Build All + strategy: + fail-fast: false + matrix: + include: + # Deprecate 20.04appimage + # - os: ubuntu-20.04 + - os: ubuntu-24.04 + - os: windows-latest + arch: x64 + - os: windows-latest + arch: arm64 + - os: macos-14 + arch: arm64 + uses: ./.github/workflows/build_check_cache.yml + with: + os: ${{ matrix.os }} + arch: ${{ matrix.arch }} + build-deps-only: ${{ inputs.build-deps-only || false }} + secrets: inherit + flatpak: + name: "Flatpak" + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-46 + options: --privileged + volumes: + - /usr/local/lib/android:/usr/local/lib/android + - /usr/share/dotnet:/usr/share/dotnet + - /opt/ghc:/opt/ghc1 + - /usr/local/share/boost:/usr/local/share/boost1 + strategy: + matrix: + variant: + - arch: x86_64 + runner: ubuntu-24.04 + - arch: aarch64 + runner: ubuntu-24.04-arm + runs-on: ${{ matrix.variant.runner }} + env: + date: + ver: + ver_pure: + steps: + - name: "Remove unneeded stuff to free disk space" + run: + rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" + - uses: actions/checkout@v4 + - name: Get the version and date + run: | + ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2) + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + ver="PR-${{ github.event.number }}" + else + ver=V$ver_pure + fi + echo "ver=$ver" >> $GITHUB_ENV + echo "ver_pure=$ver_pure" >> $GITHUB_ENV + echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV + shell: bash + - uses: flathub-infra/flatpak-github-actions/flatpak-builder@master + with: + bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak + manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml + cache: true + arch: ${{ matrix.variant.arch }} + upload-artifact: false + - name: Upload artifacts Flatpak + uses: actions/upload-artifact@v4 + with: + name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak + path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak' + - name: Deploy Flatpak to nightly release + if: ${{github.ref == 'refs/heads/main'}} + uses: WebFreak001/deploy-nightly@v3.2.0 + with: + upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} + release_id: 137995723 + asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak + asset_name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak + 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/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 75e78e344a5..5a4134d41e6 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -153,9 +153,15 @@ jobs: # Windows - name: setup MSVC - if: inputs.os == 'windows-latest' + if: inputs.os == 'windows-latest' && inputs.arch == 'x64' uses: microsoft/setup-msbuild@v2 + - name: setup MSVC for arm64 + if: inputs.os == 'windows-latest' && inputs.arch == 'arm64' + uses: microsoft/setup-msbuild@v2 + with: + architecture: 'arm64' + - name: Install nsis if: inputs.os == 'windows-latest' run: | @@ -163,13 +169,21 @@ jobs: choco install nsis - name: Build slicer Win - if: inputs.os == 'windows-latest' + if: inputs.os == 'windows-latest' && inputs.arch == 'x64' working-directory: ${{ github.workspace }} env: WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\' WindowsSDKVersion: '10.0.22000.0\' run: .\build_release_vs2022.bat slicer + - name: Build slicer Win arm64 + if: inputs.os == 'windows-latest' && inputs.arch == 'arm64' + working-directory: ${{ github.workspace }} + env: + WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\' + WindowsSDKVersion: '10.0.22000.0\' + run: .\build_release_vs2022.bat slicer arm64 + - name: Create installer Win if: inputs.os == 'windows-latest' working-directory: ${{ github.workspace }}/build diff --git a/build_release_vs2022.bat b/build_release_vs2022.bat index d4a26da99a3..8a7cf34e1cd 100644 --- a/build_release_vs2022.bat +++ b/build_release_vs2022.bat @@ -45,7 +45,11 @@ if "%1"=="slicer" ( echo "building deps.." echo on -cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%DEPS%" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo% +if "%2"=="arm64" ( + cmake ../ -G "Visual Studio 17 2022" -A arm64 -DDESTDIR="%DEPS%" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo% +) else ( + cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%DEPS%" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo% +) cmake --build . --config %build_type% --target deps -- -m @echo off @@ -58,7 +62,11 @@ mkdir %build_dir% cd %build_dir% echo on -cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\" +if "%2"=="arm64" ( + cmake .. -G "Visual Studio 17 2022" -A arm64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\" +) else ( + cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\" +) cmake --build . --config %build_type% --target ALL_BUILD -- -m @echo off cd ..