diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5b4077a1c87..f19582e26e7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -104,7 +104,7 @@ jobs: run: | "./$Env:BUILD_TYPE/run_tests.exe" - - name: Package + - name: Package MSI Installer working-directory: build env: BUILD_TYPE: ${{ matrix.build_type }} @@ -113,12 +113,37 @@ jobs: mkdir upload mv *.msi upload/ - - uses: actions/upload-artifact@v4 + - name: Upload MSI Installer + uses: actions/upload-artifact@v4 with: name: "windows-${{ matrix.arch }}-${{ matrix.build_type }}${{ matrix.glbinding == 'ON' && '-glbinding' || '' }}-installer" path: build/upload/*.msi if-no-files-found: ignore + - name: Package Portable Archive + working-directory: build + env: + BUILD_TYPE: ${{ matrix.build_type }} + run: | + mkdir -Force SuperTux-${{ github.sha }}-portable + cmake --install . --config $Env:BUILD_TYPE --prefix .\SuperTux-${{ github.sha }}-portable + + # Because github puts assets in zips, if you upload a zip, + # it will upload another zip. I have disabled this code because + # of that, but in case you wanted to know how to generate a portable release, + # here it is. + <# + cpack -C $Env:BUILD_TYPE -G ZIP + mv *.zip SuperTux-${{ github.sha }}-portable/ + #> + + - name: Upload Portable Package + uses: actions/upload-artifact@v4 + with: + name: "windows-${{ matrix.arch }}-${{ matrix.build_type }}${{ matrix.glbinding == 'ON' && '-glbinding' || '' }}-portable" + path: build/SuperTux-${{ github.sha }}-portable + if-no-files-found: ignore + - uses: anshulrgoyal/upload-s3-action@master if: matrix.release && env.CI_KEY != null env: @@ -147,5 +172,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: 'build/upload/SuperTux-*' + files: 'build/upload/SuperTux-*.msi' draft: true diff --git a/mk/cmake/SuperTux/BuildInstall.cmake b/mk/cmake/SuperTux/BuildInstall.cmake index 8158dd44c03..ae28707251a 100644 --- a/mk/cmake/SuperTux/BuildInstall.cmake +++ b/mk/cmake/SuperTux/BuildInstall.cmake @@ -1,11 +1,15 @@ if(WIN32 AND NOT UNIX) - if(VCPKG_BUILD) - install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/" DESTINATION ${INSTALL_SUBDIR_BIN} FILES_MATCHING PATTERN "*.dll") - else() - install(FILES ${DLLS} DESTINATION ${INSTALL_SUBDIR_BIN}) - endif() + install(DIRECTORY $/ + DESTINATION ${INSTALL_SUBDIR_BIN} + FILES_MATCHING PATTERN "*.dll") + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png + ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico + DESTINATION ".") - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".") + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat + ${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux_portable.bat + DESTINATION ".") option(PACKAGE_VCREDIST "Package the VCREDIST libraries with the program" OFF) diff --git a/mk/cmake/SuperTux/ProvideSquirrel.cmake b/mk/cmake/SuperTux/ProvideSquirrel.cmake index 06598261908..128dca1d0c2 100644 --- a/mk/cmake/SuperTux/ProvideSquirrel.cmake +++ b/mk/cmake/SuperTux/ProvideSquirrel.cmake @@ -60,9 +60,6 @@ else() IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/sqstdlib${CMAKE_LINK_LIBRARY_SUFFIX}" INTERFACE_INCLUDE_DIRECTORIES "${SQUIRREL_PREFIX}/include") - - #For debug run purposes - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat.in" "${CMAKE_CURRENT_BINARY_DIR}/run_supertux.bat") else() add_library(LibSquirrel STATIC IMPORTED) set_target_properties(LibSquirrel PROPERTIES diff --git a/mk/msvc/run_supertux.bat b/mk/msvc/run_supertux.bat new file mode 100644 index 00000000000..d7b3ef52143 --- /dev/null +++ b/mk/msvc/run_supertux.bat @@ -0,0 +1,2 @@ +@echo off +start %~dp0\bin\supertux2.exe %* diff --git a/mk/msvc/run_supertux.bat.in b/mk/msvc/run_supertux.bat.in deleted file mode 100644 index b3a1025f5c7..00000000000 --- a/mk/msvc/run_supertux.bat.in +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -set PATH=@SQUIRREL_PREFIX@\bin;@PHYSFS_PREFIX@\bin;@DEPENDENCY_FOLDER@\dll;%PATH% - -start supertux2.exe %* \ No newline at end of file diff --git a/mk/msvc/run_supertux_portable.bat b/mk/msvc/run_supertux_portable.bat new file mode 100644 index 00000000000..48ffb48fbad --- /dev/null +++ b/mk/msvc/run_supertux_portable.bat @@ -0,0 +1,3 @@ +@echo off +set SUPERTUX2_USER_DIR=%~dp0\user\ +start %~dp0\bin\supertux2.exe %*