Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and Release ZIP
name: Release new version

on:
pull_request:
types: [closed]
branches: [main]

jobs:
release:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
Expand All @@ -18,7 +18,8 @@ jobs:
OUTPUT_PATH: ./publish
NUGET_SOURCE: "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
EXCLUDE: "*.pdb *.xml"

outputs:
version: ${{ steps.version.outputs.new }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -147,3 +148,38 @@ jobs:
/p:AssemblyVersion=${{ steps.version.outputs.new }} \
/p:FileVersion=${{ steps.version.outputs.new }}
dotnet nuget push ./nupkg/*.nupkg --source github --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate

- name: Upload publish folder for Windows installer
uses: actions/upload-artifact@v4
with:
name: publish
path: ${{ env.OUTPUT_PATH }}

build-installer:
runs-on: windows-latest
needs: build # depends on your main build job
steps:
- uses: actions/checkout@v4

# Download the published files from Linux job
- name: Download publish folder
uses: actions/download-artifact@v4
with:
name: publish
path: publish

# Install Inno Setup via Chocolatey
- name: Install Inno Setup
run: choco install innosetup --yes

# Build the installer using the same version as ZIP
- name: Build Inno Setup Installer
run: |
ISCC.exe installer\StarMapInstaller.iss /dAppVersion=${{ needs.build.outputs.version }} /dOutputName=StarMap-${{ needs.build.outputs.version }}

# Attach installer to the release
- name: Attach installer to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.build.outputs.version }}
files: installer/dist/StarMap-${{ needs.build.outputs.version }}.exe
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,6 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

installer/dist
75 changes: 75 additions & 0 deletions installer/WindowsInstaller.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[Setup]
AppName=StarMap
AppVersion={#AppVersion}
AppId={{A6C53918-1F1B-4C7B-AF34-63C696A3E822}}
DefaultDirName={pf}\StarMap
DisableDirPage=no
DisableProgramGroupPage=yes
OutputDir=dist
OutputBaseFilename={#OutputName}
Compression=lzma
SolidCompression=yes
Uninstallable=yes

[Files]
Source: "..\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs

[Icons]
Name: "{autoprograms}\StarMap"; Filename: "{app}\StarMap.exe"
Name: "{autodesktop}\StarMap"; Filename: "{app}\StarMap.exe"; Tasks: desktopicon

[Tasks]
Name: "desktopicon"; Description: "Create desktop icon"; Flags: unchecked

[UninstallDelete]
Type: files; Name: "{app}\StarMapConfig.json"

[Code]
var
DirPage: TInputDirWizardPage;
SelectedInstallDir: String;
InstallDir: String;

procedure InitializeWizard;
begin
DirPage := CreateInputDirPage(
wpSelectDir,
'KSA Install Location',
'Please select the KSA install location (folder with KSA.dll)',
'This will be used to launch KSA.',
False,
'New Folder'
);
DirPage.Add('');
DirPage.Values[0] := '';
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
ConfigFilePath: String;
JSONText: AnsiString;
SaveOK: Boolean;
ReadBack: AnsiString;
EscapedDir: String;
begin
InstallDir := ExpandConstant('{app}');
ConfigFilePath := AddBackslash(InstallDir) + 'StarMapConfig.json';

if (CurStep = ssPostInstall) and (not FileExists(ConfigFilePath)) then
begin
if (DirPage <> nil) and (DirPage.Values[0] <> '') then
SelectedInstallDir := DirPage.Values[0]
else
SelectedInstallDir := WizardDirValue;

SelectedInstallDir := ExpandConstant(SelectedInstallDir);



EscapedDir := SelectedInstallDir;
StringChangeEx(EscapedDir, '\', '\\', True);

JSONText := '{' + '"GameLocation": "' + EscapedDir + '",' + '"RepositoryLocation": ""' + '}';
SaveOK := SaveStringToFile(ConfigFilePath, JSONText, False);
end;
end;
Loading