Skip to content

Commit 9a2cd11

Browse files
committed
Setup automated Windows installer build
- Upgrade vcxproj - Retrieve dlls from build directories - Use define for version number in Inno Setup
1 parent 32f72bd commit 9a2cd11

File tree

3 files changed

+126
-27
lines changed

3 files changed

+126
-27
lines changed

.github/workflows/ci.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Celestia
2+
3+
on:
4+
push:
5+
branches: [ 1.6.x ]
6+
paths: [ src/**, .github/workflows/ci.yml, celestia.sln, celestia.vcxproj, celestia.iss ]
7+
pull_request:
8+
branches: [ 1.6.x ]
9+
paths: [ src/**, .github/workflows/ci.yml, celestia.sln, celestia.vcxproj, celestia.iss ]
10+
11+
jobs:
12+
build-windows:
13+
name: "Build and package Windows"
14+
runs-on: windows-latest
15+
strategy:
16+
fail-fast: false
17+
18+
steps:
19+
- name: Update vcpkg
20+
shell: pwsh
21+
run: |
22+
$vcpkgCommit = '69efe9cc2df0015f0bb2d37d55acde4a75c9a25b'
23+
pushd $env:VCPKG_INSTALLATION_ROOT
24+
git fetch --depth=1 origin $vcpkgCommit
25+
git reset --hard $vcpkgCommit
26+
./bootstrap-vcpkg.bat
27+
popd
28+
29+
- name: Setup Nuget Credentials
30+
shell: pwsh
31+
run: |
32+
$nugetCmd = vcpkg fetch nuget | Select-Object -Last 1
33+
$nugetSource = 'https://nuget.pkg.github.com/CelestiaProject/index.json'
34+
& "$nugetCmd" sources add `
35+
-Source "$nugetSource" `
36+
-StorePasswordInClearText `
37+
-Name "GitHub" `
38+
-Username 'CelestiaProject' `
39+
-Password '${{secrets.GITHUB_TOKEN}}'
40+
& "$nugetCmd" setapikey '${{secrets.GITHUB_TOKEN}}' `
41+
-Source "$nugetSource"
42+
43+
- name: Setup vcpkg integration
44+
shell: pwsh
45+
run: |
46+
vcpkg integrate install
47+
48+
- name: Install dependencies (x64)
49+
shell: pwsh
50+
run: |
51+
vcpkg --triplet=x64-windows install --recurse libpng libjpeg-turbo gettext[tools] luajit cspice
52+
echo "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/tools/gettext/bin" >> $env:GITHUB_PATH
53+
54+
- name: Install dependencies (x86)
55+
shell: pwsh
56+
run: |
57+
vcpkg --triplet=x86-windows install --recurse libpng libjpeg-turbo gettext luajit cspice
58+
59+
- name: Checkout source code
60+
uses: actions/checkout@v3
61+
62+
- name: Build Win32
63+
shell: pwsh
64+
run: |
65+
$installationPath = vswhere.exe -prerelease -latest -property installationPath
66+
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
67+
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo -arch=x86 -host_arch=amd64 && set" | ForEach-Object {
68+
$name, $value = $_ -split '=', 2
69+
Set-Content env:\"$name" $value
70+
}
71+
}
72+
$VcpkgIncludeDir32 = "$env:VCPKG_INSTALLATION_ROOT/installed/x86-windows/include"
73+
msbuild celestia.sln /p:Configuration=Release /p:Platform=Win32 "/p:IncludePath=`"$VcpkgIncludeDir32/cspice;$VcpkgIncludeDir32/luajit`""
74+
perl po/translate_resources.pl Win32
75+
76+
- name: Build x64
77+
shell: pwsh
78+
run: |
79+
$installationPath = vswhere.exe -prerelease -latest -property installationPath
80+
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
81+
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo -arch=amd64 -host_arch=amd64 && set" | ForEach-Object {
82+
$name, $value = $_ -split '=', 2
83+
Set-Content env:\"$name" $value
84+
}
85+
}
86+
$VcpkgIncludeDir64 = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/include"
87+
msbuild celestia.sln /p:Configuration=Release /p:Platform=x64 "/p:IncludePath=`"$VcpkgIncludeDir64/cspice;$VcpkgIncludeDir64/luajit`""
88+
perl po/translate_resources.pl x64
89+
90+
- name: Create installer
91+
shell: pwsh
92+
run: ISCC celestia.iss
93+
94+
- name: Upload artifacts
95+
uses: actions/upload-artifact@v3
96+
if: success()
97+
with:
98+
name: celestia-windows-installer
99+
path: |
100+
${{github.workspace}}/Output/**.exe

celestia.iss

+21-22
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33

44
; This script was tested with Inno Setup Compiler version 5.1.5
55

6+
#define CelestiaVersion "1.6.3"
7+
68
[Setup]
79
AppName=Celestia
8-
AppVersion=1.6.3
9-
VersionInfoVersion=1.6.3
10+
AppVersion={#CelestiaVersion}
11+
VersionInfoVersion={#CelestiaVersion}
1012
AppPublisher=Celestia Development Team
1113
AppPublisherURL=https://celestia.space/
1214
AppSupportURL=https://celestia.space/
1315
AppUpdatesURL=https://celestia.space/
1416
AppCopyright=Copyright (C) 2001-2023 Celestia Development Team
17+
OutputBaseFilename=celestia-{#CelestiaVersion}
1518
DefaultDirName={code:DefDirRoot}\Celestia
1619
DefaultGroupName=Celestia
1720
LicenseFile=COPYING
@@ -67,24 +70,22 @@ Name: "{app}\help"
6770
Name: "{app}\help\CelestiaGuide"
6871

6972
[Files]
70-
Source: "x64\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
71-
Source: "win32\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
72-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
73-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
74-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
75-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
76-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
77-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
78-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libiconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
79-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libiconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
80-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libcharset.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
81-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libcharset.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
82-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
83-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
84-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
85-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
86-
Source: "c:\tools\vcpkg\installed\x64-windows\bin\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
87-
Source: "c:\tools\vcpkg\installed\x86-windows\bin\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
73+
Source: "x64\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
74+
Source: "Win32\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
75+
Source: "x64\Release\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
76+
Source: "Win32\Release\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
77+
Source: "x64\Release\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
78+
Source: "Win32\Release\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
79+
Source: "x64\Release\intl-8.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
80+
Source: "Win32\Release\intl-8.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
81+
Source: "x64\Release\iconv-2.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
82+
Source: "Win32\Release\iconv-2.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
83+
Source: "x64\Release\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
84+
Source: "Win32\Release\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
85+
Source: "x64\Release\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
86+
Source: "Win32\Release\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
87+
Source: "x64\Release\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
88+
Source: "Win32\Release\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
8889
Source: "start.cel"; DestDir: "{app}"; Flags: ignoreversion
8990
Source: "celestia.cfg"; DestDir: "{app}"; Flags: ignoreversion
9091
Source: "demo.cel"; DestDir: "{app}"; Flags: ignoreversion
@@ -187,8 +188,6 @@ Source: "locale\nb\LC_MESSAGES\celestia.mo"; DestDir: "{app
187188
Source: "locale\nb\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/nb/LC_MESSAGES"; Flags: ignoreversion
188189
Source: "locale\nl\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/nl/LC_MESSAGES"; Flags: ignoreversion
189190
Source: "locale\nl\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/nl/LC_MESSAGES"; Flags: ignoreversion
190-
Source: "locale\no\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/no/LC_MESSAGES"; Flags: ignoreversion
191-
Source: "locale\no\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/no/LC_MESSAGES"; Flags: ignoreversion
192191
Source: "locale\pl\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/pl/LC_MESSAGES"; Flags: ignoreversion
193192
Source: "locale\pl\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/pl/LC_MESSAGES"; Flags: ignoreversion
194193
Source: "locale\pt\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/pt/LC_MESSAGES"; Flags: ignoreversion

celestia.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
</ItemGroup>
2121
<PropertyGroup Label="Globals">
2222
<ProjectGuid>{DDDE8EA8-F55A-491B-A102-11C9C01B4B58}</ProjectGuid>
23-
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
23+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2424
</PropertyGroup>
2525
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2626
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2727
<ConfigurationType>Application</ConfigurationType>
28-
<PlatformToolset>v141</PlatformToolset>
28+
<PlatformToolset>v143</PlatformToolset>
2929
</PropertyGroup>
3030
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
3131
<ConfigurationType>Application</ConfigurationType>
32-
<PlatformToolset>v141</PlatformToolset>
32+
<PlatformToolset>v143</PlatformToolset>
3333
</PropertyGroup>
3434
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3535
<ConfigurationType>Application</ConfigurationType>
36-
<PlatformToolset>v141</PlatformToolset>
36+
<PlatformToolset>v143</PlatformToolset>
3737
</PropertyGroup>
3838
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
3939
<ConfigurationType>Application</ConfigurationType>
40-
<PlatformToolset>v141</PlatformToolset>
40+
<PlatformToolset>v143</PlatformToolset>
4141
</PropertyGroup>
4242
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
4343
<ImportGroup Label="ExtensionSettings">

0 commit comments

Comments
 (0)