From 7180f106001f5d386f22846553b7826728989462 Mon Sep 17 00:00:00 2001 From: Arslan Date: Sat, 23 Nov 2024 22:43:45 +0100 Subject: [PATCH] wix package build in pipeline --- .../build-windows-executable-app.yaml | 80 +++++++++++++++---- .../workflows/test-win-exe-w-embed-py.yaml | 15 ++-- 2 files changed, 73 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-windows-executable-app.yaml b/.github/workflows/build-windows-executable-app.yaml index 8b86e01a..b7dd37c9 100644 --- a/.github/workflows/build-windows-executable-app.yaml +++ b/.github/workflows/build-windows-executable-app.yaml @@ -1,9 +1,9 @@ name: Build executable for Windows on: - #push: - # branches: [ "main" ] - #pull_request: - # branches: [ "main" ] + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] workflow_dispatch: env: OPENMS_VERSION: 3.2.0 @@ -220,7 +220,7 @@ jobs: mkdir streamlit_exe mv python-${{ env.PYTHON_VERSION }} streamlit_exe - mv run_app.bat streamlit_exe + #mv run_app.bat streamlit_exe cp -r src streamlit_exe cp -r content streamlit_exe cp -r docs streamlit_exe @@ -237,19 +237,71 @@ jobs: foreach ($file in $files) { Copy-Item "openms-bin/${file}.exe" -Destination "streamlit_exe/${file}.exe" } + + - name: Install WiX Toolset + run: | + curl -LO https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip + unzip wix311-binaries.zip -d wix + rm wix311-binaries.zip + + - name: build .wxs for streamlit_exe folder + run: | + ./wix/heat.exe dir streamlit_exe -gg -sfrag -sreg -srd -template component -cg StreamlitExeFiles -dr INSTALLFOLDER -out streamlit_exe_files.wxs + + - name: CopytoSrcDir + run: | + mkdir SourceDir + cp -r streamlit_exe/* SourceDir + mv run_app.bat SourceDir + cp dummy_license.rtf SourceDir + + - name: Generate WiX XML file + run: | + echo '' > streamlit_exe.wxs + echo '' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' > streamlit_exe.wxs + echo ' ExeCommand="cmd.exe /c "[INSTALLFOLDER]run_app.bat"" />' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' NOT REMOVE' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs + echo '' >> streamlit_exe.wxs + - name: Build msi + run: | + ./wix/candle.exe streamlit_exe.wxs streamlit_exe_files.wxs + ./wix/light.exe -ext WixUIExtension -sice:ICE60 -o Streamlit-template-installer-test.msi streamlit_exe_files.wixobj streamlit_exe.wixobj + - name: Delete OpenMS bin artifact uses: geekyeggo/delete-artifact@v5 with: name: openms-package - - - name: Compress streamlit_exe folder to OpenMS-App.zip - run: | - 7z a OpenMS-App.zip ./streamlit_exe/* -r - - - name: Upload artifact + + - name: Archive build artifacts uses: actions/upload-artifact@v4 with: - name: OpenMS-App - path: OpenMS-App.zip - + name: OpenMS-StreamlitTemplateApp + path: | + OpenMS-StreamlitTemplateApp.msi diff --git a/.github/workflows/test-win-exe-w-embed-py.yaml b/.github/workflows/test-win-exe-w-embed-py.yaml index f43ed56e..342772db 100644 --- a/.github/workflows/test-win-exe-w-embed-py.yaml +++ b/.github/workflows/test-win-exe-w-embed-py.yaml @@ -52,10 +52,13 @@ jobs: mv python-${{ env.PYTHON_VERSION }} streamlit_exe cp -r src streamlit_exe cp -r content streamlit_exe + cp -r docs streamlit_exe cp -r assets streamlit_exe cp -r example-data streamlit_exe cp -r .streamlit streamlit_exe cp app.py streamlit_exe + cp settings.json streamlit_exe + cp default-parameters.json streamlit_exe - name: Install WiX Toolset run: | @@ -78,7 +81,7 @@ jobs: run: | echo '' > streamlit_exe.wxs echo '' >> streamlit_exe.wxs - echo ' ' >> streamlit_exe.wxs + echo ' ' >> streamlit_exe.wxs echo ' ' >> streamlit_exe.wxs echo ' ' >> streamlit_exe.wxs echo ' ' >> streamlit_exe.wxs @@ -111,15 +114,11 @@ jobs: - name: Build msi run: | ./wix/candle.exe streamlit_exe.wxs streamlit_exe_files.wxs - ./wix/light.exe -ext WixUIExtension -sice:ICE60 -o Streamlit-template-installer.msi streamlit_exe_files.wixobj streamlit_exe.wixobj + ./wix/light.exe -ext WixUIExtension -sice:ICE60 -o Streamlit-template-installer-test.msi streamlit_exe_files.wixobj streamlit_exe.wixobj - name: Archive build artifacts uses: actions/upload-artifact@v4 with: - name: Streamlit-template-installer + name: Streamlit-template-installer-test path: | - *.wixobj - *.wxs - SourceDir/** - streamlit_exe/** - Streamlit-template-installer.msi + Streamlit-template-installer-test.msi