Skip to content

Commit 3f092db

Browse files
committed
Create bundle-build.yml
1 parent e5bca9d commit 3f092db

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.github/workflows/bundle-build.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Bundle Build
2+
3+
on:
4+
push:
5+
branches: [ "exe-build" ]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
env:
11+
parallel_processes: 6 # A good default counts is: available Threads + 2
12+
13+
jobs:
14+
build:
15+
runs-on: windows-latest
16+
strategy:
17+
matrix:
18+
build_type: ["MinSizeRel"]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Qt
24+
uses: jurplel/install-qt-action@v4
25+
with:
26+
aqtversion: '==3.1.*'
27+
version: '6.5.1'
28+
host: 'windows'
29+
target: 'desktop'
30+
cache: true
31+
arch: 'win64_msvc2019_64'
32+
modules: 'qt3d qtactiveqt qtcharts qtconnectivity qtdatavis3d qtgrpc qthttpserver qtimageformats qtlanguageserver qtlocation qtlottie qtmultimedia qtnetworkauth qtpdf qtpositioning qtquick3dphysics qtquickeffectmaker qtremoteobjects qtscxml qtsensors qtserialbus qtserialport qtspeech qtvirtualkeyboard qtwebchannel qtwebengine qtwebsockets qtwebview debug_info qt5compat qtquick3d qtquicktimeline qtshadertools'
33+
34+
- name: Cache Inno Setup
35+
id: cache-innosetup
36+
uses: actions/cache@v4
37+
with:
38+
path: innosetup.exe
39+
key: innosetup-6.4.3
40+
41+
- name: Download Inno Setup
42+
if: steps.cache-innosetup.outputs.cache-hit != 'true'
43+
shell: powershell
44+
run: |
45+
wget -O innosetup.exe "https://jrsoftware.org/download.php/innosetup-6.4.3.exe"
46+
47+
- name: Install Inno Setup
48+
run: |
49+
./innosetup.exe /silent /dir=${{github.workspace}}/innoSetup /CURRENTUSER /NOICONS
50+
set innoPath=
51+
set PATH=%PATH%;${{github.workspace}}/innoSetup
52+
53+
# Packages should be automatically downloaded using vcpkg through the toolchain
54+
- name: Configure CMake
55+
env:
56+
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}
57+
# Choose CMakeLists.text from a specific source directory with -S.
58+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
59+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
60+
run: |
61+
cmake -B build -S . -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=stellarium-bin -DSCM_SHOULD_ENABLE_CONVERTER=OFF
62+
63+
- name: Build
64+
# Build your program with the given configuration
65+
run: |
66+
cmake --build build --config ${{matrix.build_type}} -j ${{env.parallel_processes}} --target install
67+
68+
- name: Build Installer
69+
run: |
70+
cmake --build build --config ${{matrix.build_type}} -j ${{env.parallel_processes}} --target stellarium-installer
71+
72+
# We use the first find as it should only be one
73+
- name: Install Stellarium for Bundeling
74+
run: |
75+
$installer = Get-ChildItem -Path installers -Recurse -Filter 'stellarium-*-qt6-win64.exe' | Select-Object -First 1
76+
if ($installer) {
77+
New-Item -ItemType Directory -Path stellarium-installer -Force | Out-Null
78+
Copy-Item $installer.FullName stellarium-installer\
79+
80+
$quickInstallScript = "stellarium-installer\quickInstall.bat"
81+
$installerRelativePath = ".\" + $installer.Name
82+
$quickInstallContent = "`"$installerRelativePath`" /silent /dir=stellarium /CURRENTUSER /NOICONS /LOG=`"installation.log`" /MERGETASKS=`"!desktopicon`""
83+
$quickInstallContent += "`r`nmklink stellarium.exe stellarium\stellarium.exe"
84+
Set-Content -Path $quickInstallScript -Value $quickInstallContent
85+
} else {
86+
Write-Error "Installer not found."
87+
}
88+
89+
- name: Deploy Stellarium installer
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: stellarium-windows-installer
93+
path: stellarium-installer
94+
retention-days: 3 # Don't store to long as stellarium builds are large

0 commit comments

Comments
 (0)