Skip to content

Commit

Permalink
wix package build in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Arslan-Siraj committed Nov 23, 2024
1 parent f078c03 commit 7180f10
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 22 deletions.
80 changes: 66 additions & 14 deletions .github/workflows/build-windows-executable-app.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 '<?xml version="1.0"?>' > streamlit_exe.wxs
echo '<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">' >> streamlit_exe.wxs
echo ' <Product Id="*" Name="OpenMS-StreamlitTemplateApp" Language="1033" Version="1.0.0.0" Manufacturer="OpenMS" UpgradeCode="8d28e8c7-45dc-446c-b889-99a6aea2f1a5">' >> streamlit_exe.wxs
echo ' <Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine"/>' >> streamlit_exe.wxs
echo ' <Media Id="1" Cabinet="streamlit.cab" EmbedCab="yes" />' >> streamlit_exe.wxs
echo ' <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />' >> streamlit_exe.wxs
echo ' <Property Id="INSTALLFOLDER" Secure="yes" />' >> streamlit_exe.wxs
echo ' <Directory Id="TARGETDIR" Name="SourceDir">' >> streamlit_exe.wxs
echo ' <Directory Id="ProgramFilesFolder">' >> streamlit_exe.wxs
echo ' <Directory Id="INSTALLFOLDER" Name="StreamlitApp" />' >> streamlit_exe.wxs
echo ' </Directory>' >> streamlit_exe.wxs
echo ' </Directory>' >> streamlit_exe.wxs
echo ' <Feature Id="MainFeature" Title="Main Application" Level="1">' >> streamlit_exe.wxs
echo ' <ComponentGroupRef Id="StreamlitExeFiles" />' >> streamlit_exe.wxs
echo ' <ComponentRef Id="BatFileComponent" />' >> streamlit_exe.wxs
echo ' </Feature>' >> streamlit_exe.wxs
echo ' <Component Id="BatFileComponent" Guid="7aa6c3dc-f78e-40ce-b6a1-e11240af3c84" Directory="INSTALLFOLDER">' >> streamlit_exe.wxs
echo ' <File Id="BatFile" Source="SourceDir/run_app.bat" KeyPath="yes" />' >> streamlit_exe.wxs
echo ' </Component>' >> streamlit_exe.wxs
echo ' <CustomAction Id="RunBatchFile" Directory="INSTALLFOLDER" Execute="deferred" Return="asyncNoWait"' >> streamlit_exe.wxs
echo ' ExeCommand="cmd.exe /c &quot;[INSTALLFOLDER]run_app.bat&quot;" />' >> streamlit_exe.wxs
echo ' <InstallExecuteSequence>' >> streamlit_exe.wxs
echo ' <Custom Action="RunBatchFile" Before="InstallFinalize">NOT REMOVE</Custom>' >> streamlit_exe.wxs
echo ' </InstallExecuteSequence>' >> streamlit_exe.wxs
echo ' <UI>' >> streamlit_exe.wxs
echo ' <UIRef Id="WixUI_InstallDir" />' >> streamlit_exe.wxs
echo ' <UIRef Id="WixUI_ErrorProgressText" />' >> streamlit_exe.wxs
echo ' </UI>' >> streamlit_exe.wxs
echo ' <WixVariable Id="WixUILicenseRtf" Value="SourceDir/dummy_license.rtf" />' >> streamlit_exe.wxs
echo ' </Product>' >> streamlit_exe.wxs
echo '</Wix>' >> 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
15 changes: 7 additions & 8 deletions .github/workflows/test-win-exe-w-embed-py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -78,7 +81,7 @@ jobs:
run: |
echo '<?xml version="1.0"?>' > streamlit_exe.wxs
echo '<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">' >> streamlit_exe.wxs
echo ' <Product Id="*" Name="StreamlitApp" Language="1033" Version="1.0.0.0" Manufacturer="OpenMS" UpgradeCode="8d28e8c7-45dc-446c-b889-99a6aea2f1a5">' >> streamlit_exe.wxs
echo ' <Product Id="*" Name="OpenMS-StreamlitTemplateApp" Language="1033" Version="1.0.0.0" Manufacturer="OpenMS" UpgradeCode="8d28e8c7-45dc-446c-b889-99a6aea2f1a5">' >> streamlit_exe.wxs
echo ' <Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine"/>' >> streamlit_exe.wxs
echo ' <Media Id="1" Cabinet="streamlit.cab" EmbedCab="yes" />' >> streamlit_exe.wxs
echo ' <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />' >> streamlit_exe.wxs
Expand Down Expand Up @@ -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

0 comments on commit 7180f10

Please sign in to comment.