Skip to content

Commit

Permalink
Setup automated Windows installer build
Browse files Browse the repository at this point in the history
- Upgrade vcxproj
- Retrieve dlls from build directories
- Use define for version number in Inno Setup
  • Loading branch information
ajtribick committed Apr 13, 2023
1 parent 7095367 commit e9a70d6
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 27 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Celestia

on:
push:
branches: [ 1.6.x ]
paths: [ src/**, .github/workflows/ci.yml, celestia.sln, celestia.vcxproj, celestia.iss ]
pull_request:
branches: [ 1.6.x ]
paths: [ src/**, .github/workflows/ci.yml, celestia.sln, celestia.vcxproj, celestia.iss ]

env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'

jobs:
build-windows:
name: "Build and package Windows"
runs-on: windows-latest
strategy:
fail-fast: false

steps:
- name: Update vcpkg
shell: pwsh
run: |
$vcpkgCommit = '69efe9cc2df0015f0bb2d37d55acde4a75c9a25b'
pushd $env:VCPKG_INSTALLATION_ROOT
git fetch --depth=1 origin $vcpkgCommit
git reset --hard $vcpkgCommit
./bootstrap-vcpkg.bat
popd
- name: Setup Nuget Credentials
shell: pwsh
run: |
$nugetCmd = vcpkg fetch nuget | Select-Object -Last 1
$nugetSource = 'https://nuget.pkg.github.com/CelestiaProject/index.json'
& "$nugetCmd" sources add `
-Source "$nugetSource" `
-StorePasswordInClearText `
-Name "GitHub" `
-Username 'CelestiaProject' `
-Password '${{secrets.GITHUB_TOKEN}}'
& "$nugetCmd" setapikey '${{secrets.GITHUB_TOKEN}}' `
-Source "$nugetSource"
- name: Setup vcpkg integration
shell: pwsh
run: |
vcpkg integrate install
- name: Install dependencies (x64)
shell: pwsh
run: |
vcpkg --triplet=x64-windows install --recurse libpng libjpeg-turbo gettext[tools] luajit cspice
echo "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/tools/gettext/bin" >> $env:GITHUB_PATH
- name: Install dependencies (x86)
shell: pwsh
run: |
vcpkg --triplet=x86-windows install --recurse libpng libjpeg-turbo gettext luajit cspice
- name: Checkout source code
uses: actions/checkout@v3

- name: Build Win32
shell: pwsh
run: |
$installationPath = vswhere.exe -prerelease -latest -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo -arch=x86 -host_arch=amd64 && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
Set-Content env:\"$name" $value
}
}
$VcpkgIncludeDir32 = "$env:VCPKG_INSTALLATION_ROOT/installed/x86-windows/include"
msbuild celestia.sln /p:Configuration=Release /p:Platform=Win32 "/p:IncludePath=`"$VcpkgIncludeDir32/cspice;$VcpkgIncludeDir32/luajit`""
perl po/translate_resources.pl Win32
- name: Build x64
shell: pwsh
run: |
$installationPath = vswhere.exe -prerelease -latest -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo -arch=amd64 -host_arch=amd64 && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
Set-Content env:\"$name" $value
}
}
$VcpkgIncludeDir64 = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/include"
msbuild celestia.sln /p:Configuration=Release /p:Platform=x64 "/p:IncludePath=`"$VcpkgIncludeDir64/cspice;$VcpkgIncludeDir64/luajit`""
perl po/translate_resources.pl x64
- name: Create installer
shell: pwsh
run: ISCC celestia.iss

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: success()
with:
name: celestia-windows-installer
path: |
${{github.workspace}}/Output/**.exe
43 changes: 21 additions & 22 deletions celestia.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@

; This script was tested with Inno Setup Compiler version 5.1.5

#define CelestiaVersion "1.6.3"

[Setup]
AppName=Celestia
AppVersion=1.6.3
VersionInfoVersion=1.6.3
AppVersion={#CelestiaVersion}
VersionInfoVersion={#CelestiaVersion}
AppPublisher=Celestia Development Team
AppPublisherURL=https://celestia.space/
AppSupportURL=https://celestia.space/
AppUpdatesURL=https://celestia.space/
AppCopyright=Copyright (C) 2001-2023 Celestia Development Team
OutputBaseFilename=celestia-{#CelestiaVersion}
DefaultDirName={code:DefDirRoot}\Celestia
DefaultGroupName=Celestia
LicenseFile=COPYING
Expand Down Expand Up @@ -67,24 +70,22 @@ Name: "{app}\help"
Name: "{app}\help\CelestiaGuide"

[Files]
Source: "x64\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "win32\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libiconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libiconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libcharset.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libcharset.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x64-windows\bin\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "c:\tools\vcpkg\installed\x86-windows\bin\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\celestia.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\cspice.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\intl-8.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\intl-8.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\iconv-2.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\iconv-2.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\lua51.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "x64\Release\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
Source: "Win32\Release\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: "start.cel"; DestDir: "{app}"; Flags: ignoreversion
Source: "celestia.cfg"; DestDir: "{app}"; Flags: ignoreversion
Source: "demo.cel"; DestDir: "{app}"; Flags: ignoreversion
Expand Down Expand Up @@ -187,8 +188,6 @@ Source: "locale\nb\LC_MESSAGES\celestia.mo"; DestDir: "{app
Source: "locale\nb\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/nb/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\nl\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/nl/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\nl\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/nl/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\no\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/no/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\no\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/no/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\pl\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/pl/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\pl\LC_MESSAGES\celestia_constellations.mo"; DestDir: "{app}/locale/pl/LC_MESSAGES"; Flags: ignoreversion
Source: "locale\pt\LC_MESSAGES\celestia.mo"; DestDir: "{app}/locale/pt/LC_MESSAGES"; Flags: ignoreversion
Expand Down
10 changes: 5 additions & 5 deletions celestia.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DDDE8EA8-F55A-491B-A102-11C9C01B4B58}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down

0 comments on commit e9a70d6

Please sign in to comment.