Skip to content

Commit 35bf569

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 35bf569

File tree

3 files changed

+129
-27
lines changed

3 files changed

+129
-27
lines changed

.github/workflows/ci.yml

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