diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index 3be8a7a705..a4ccebddb9 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -4,8 +4,12 @@ name: Build the C++ binary package on: - workflow_dispatch: workflow_call: + inputs: + extra_cmake_flags: + type: string + description: Extra CMake flags to pass to the build. + default: "" env: MACOSX_DEPLOYMENT_TARGET: "11.0" @@ -64,7 +68,7 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: CMakeLists.txt - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ env.SLINT_BINARY_FEATURES }}" + cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ env.SLINT_BINARY_FEATURES }} ${{ inputs.extra_cmake_flags }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack @@ -107,7 +111,7 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: CMakeLists.txt - cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=arm-none-eabi-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_COMPILER=download ${{ env.SLINT_MCU_FEATURES }}" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=arm-none-eabi-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_COMPILER=download ${{ env.SLINT_MCU_FEATURES }} ${{ inputs.extra_cmake_flags }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack @@ -164,7 +168,7 @@ jobs: # NOTE: xtensa-esp-elf-gcc as compiler for the RISC-V targets is wrong, but the compiler argument here is only # used to ensure that SIZEOF_VOID_P is 4 in the generated cmake config file. Otherwise this build requires no # C compiler. - cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' -DSLINT_COMPILER=download ${{ env.SLINT_MCU_FEATURES }}" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' -DSLINT_COMPILER=download ${{ env.SLINT_MCU_FEATURES }} ${{ inputs.extra_cmake_flags }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack @@ -205,7 +209,7 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: CMakeLists.txt - cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSLINT_BUILD_RUNTIME=OFF" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSLINT_BUILD_RUNTIME=OFF ${{ inputs.extra_cmake_flags }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack diff --git a/.github/workflows/nightly_snapshot.yaml b/.github/workflows/nightly_snapshot.yaml index 7e7aca05e0..de0e6ef496 100644 --- a/.github/workflows/nightly_snapshot.yaml +++ b/.github/workflows/nightly_snapshot.yaml @@ -63,6 +63,8 @@ jobs: rustflags: "--cfg=web_sys_unstable_apis" cpp_package: uses: ./.github/workflows/cpp_package.yaml + with: + extra_cmake_flags: ${{ github.event.inputs.release && '' || '-DCPACK_PACKAGE_VERSION=nightly' }} check-for-secrets: runs-on: ubuntu-latest @@ -508,7 +510,7 @@ jobs: major=`echo $version | sed -e "s,\([0-9]*\)\.[0-9]*\.[0-9]*,\1,"` echo "MAJOR_VERSION=$major" >> $GITHUB_OUTPUT minor=`echo $version | sed -e "s,[0-9]*\.\([0-9]*\)\.[0-9]*,\1,"` - echo "MINOR_VERSION=$minor" >> $GITHUB_OUTPUT + echo "MINOR_VERSION=$minor" >> $GITHUB_OUTPUT - uses: montudor/action-zip@v1 with: args: zip -r artifacts/slint-viewer-windows.zip slint-viewer @@ -518,13 +520,13 @@ jobs: - uses: actions/checkout@v4 with: path: "slint-src" - sparse-checkout: docs + sparse-checkout: docs - name: prepare release notes env: RELEASE_INPUT: ${{ github.event.inputs.release }} run: | if [ "$RELEASE_INPUT" != "true" ]; then - notes_file=slint-src/docs/_templates/nightly-release-notes.md + notes_file=slint-src/docs/_templates/nightly-release-notes.md else notes_file=slint-src/docs/_templates/release-notes.md fi @@ -536,7 +538,7 @@ jobs: sed -i -e "s,{download_version},nightly,g" release-notes.md else sed -i -e "s,{download_version},${{ steps.version.outputs.VERSION}},g" release-notes.md - fi + fi cat release-notes.md - uses: ncipollo/release-action@v1 if: github.event.inputs.release == 'true' diff --git a/api/cpp/esp-idf/slint/cmake/FindSlint.cmake b/api/cpp/esp-idf/slint/cmake/FindSlint.cmake index 48529c43bd..6ca82b8bb1 100644 --- a/api/cpp/esp-idf/slint/cmake/FindSlint.cmake +++ b/api/cpp/esp-idf/slint/cmake/FindSlint.cmake @@ -19,7 +19,7 @@ # is happening in an ESP-IDF cross-compilation environment and detect the architecture accordingly, otherwise # `${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}` is used. # -# `SLINT_USE_NIGHTLY_VERSION`: When `find_package(Slint)` is called with a version, then this module will +# `SLINT_USE_NIGHTLY_VERSION`: When `find_package(Slint)` is called with a version, then this module will # attempt to download a pre-compiled binary from the nightly snapshot of Slint. find_package(Slint ${Slint_FIND_VERSION} QUIET CONFIG) @@ -64,6 +64,7 @@ set(github_release "${slint_version}") if (SLINT_USE_NIGHTLY_VERSION) set(github_release "nightly") + set(slint_version "nightly") # Set this to instruct the slint-compiler download to use the same release set(SLINT_GITHUB_RELEASE "nightly" CACHE STRING "") endif()