Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
43 changes: 43 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update Integration Test

on:
workflow_call:
workflow_dispatch:

jobs:
update-cycle:
name: Update cycle (${{ matrix.scenario.name }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
scenario:
- { name: single, script: ./test-local-update.ps1 }
- { name: dual, script: ./test-local-update-dual.ps1 }
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x

- name: Run ${{ matrix.scenario.name }}-channel update cycle
shell: pwsh
run: ${{ matrix.scenario.script }}

- name: Upload diagnostics on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: update-cycle-${{ matrix.scenario.name }}-logs
# Updater log: %TEMP%\extUpdateLog-*.txt; RawDevLauncher app log: %APPDATA%\RawDevLauncher\*.txt
path: |
${{ runner.temp }}\extUpdateLog-*.txt
${{ env.APPDATA }}\RawDevLauncher\*.txt
if-no-files-found: ignore
retention-days: 7
116 changes: 73 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,84 +13,114 @@ on:

env:
TOOL_PROJ_PATH: ./src/DevLauncher/DevLauncher.csproj
CREATOR_PROJ_PATH: ./ModdingToolBase/src/AnakinApps/ApplicationManifestCreator/ApplicationManifestCreator.csproj
UPLOADER_PROJ_PATH: ./ModdingToolBase/src/AnakinApps/FtpUploader/FtpUploader.csproj
PUBLISH_SCRIPT: ./ModdingToolBase/scripts/Publish-Release.ps1
TOOL_EXE: RaW-DevLauncher.exe
UPDATER_EXE: AnakinRaW.ExternalUpdater.exe
MANIFEST_CREATOR: AnakinRaW.ApplicationManifestCreator.dll
SFTP_UPLOADER: AnakinRaW.FtpUploader.dll
EMBEDDED_TRUST_CERT: src/DevLauncher/Resources/Certs/anakinraw-trust.cer
ORIGIN_BASE: https://republicatwar.com/downloads/RawDevLauncher
ORIGIN_BASE_PART: downloads/RawDevLauncher/
SFTP_BASE_PATH: downloads/RawDevLauncher/
BRANCH_NAME: ${{ github.event.inputs.branch || 'stable' }}

# Migration-release values. Leave empty for a normal release; populate to enable.
#
# Origin URL of the next-generation channel, written into the manifest's componentOriginInfo.
NEXT_ORIGIN_BASE: https://republicatwar.com/downloads/RawDevLauncher/v2

# SFTP path the next-generation channel uploads to. Set together with NEXT_ORIGIN_BASE.
NEXT_SFTP_BASE_PATH: downloads/RawDevLauncher/v2/

# Previously-deployed updater used in place of the build-output one for the primary deploy.
# Only the old-gen manifest lists this binary; the next-gen manifest still uses the build-output updater.
# Requires NEXT_ORIGIN_BASE + NEXT_SFTP_BASE_PATH to be set.
COMPAT_UPDATER: tools/v1/AnakinRaW.ExternalUpdater.exe

jobs:

build:
name: Build
# Builds and tests the solution.
test:
uses: ./.github/workflows/test.yml

# End-to-end self-update test
integration-test:
needs: [test]
uses: ./.github/workflows/integration-test.yml

pack:
name: Pack
needs: [test]
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Build
run: dotnet build ${{ env.TOOL_PROJ_PATH }} --configuration Release --output ./binaries
uses: actions/setup-dotnet@v5
- name: Create NetFramework Release
# use build for .NET Framework to enusre external updater exe is included
run: dotnet build ${{ env.TOOL_PROJ_PATH }} --configuration Release -f net481 --output ./releases/net481 /p:DebugType=None /p:DebugSymbols=false
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: Build Artifacts
path: |
binaries/${{env.TOOL_EXE}}
binaries/${{env.UPDATER_EXE}}
name: Binary Releases
path: ./releases
if-no-files-found: error
retention-days: 1

deploy:
name: Deploy
# Only deploy on push to main or manual trigger
# Stable deploys are gated to 'main'. Non-stable channels (beta, canary, etc.) can be
# workflow_dispatched from any branch.
if: |
(github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'workflow_dispatch'
needs: [build]
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.branch != 'stable' || github.ref == 'refs/heads/main'))
needs: [pack, integration-test]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v8
with:
dotnet-version: 9.0.x
- uses: actions/download-artifact@v4
name: Binary Releases
path: ./releases
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
name: Build Artifacts
path: binaries
- name: Build Creator
run: dotnet build ${{env.CREATOR_PROJ_PATH}} --configuration Release --output ./dev
- name: Build Uploader
run: dotnet build ${{env.UPLOADER_PROJ_PATH}} --configuration Release --output ./dev
- name: Create Manifest
run: dotnet ./dev/${{env.MANIFEST_CREATOR}} -a binaries/${{env.TOOL_EXE}} --appDataFiles binaries/${{env.UPDATER_EXE}} --origin ${{env.ORIGIN_BASE}} -o ./binaries -b ${{env.BRANCH_NAME}}
- name: Upload Build
run: dotnet ./dev/${{env.SFTP_UPLOADER}} ftp --host $host --port $port -u ${{secrets.SFTP_USER}} -p ${{secrets.SFTP_PASSWORD}} --base $base_path -s $source
env:
host: republicatwar.com
port: 1579
base_path: ${{env.ORIGIN_BASE_PART}}
source: ./binaries
dotnet-version: 10.0.x


- name: Publish self-update release
shell: pwsh
run: |
& $env:PUBLISH_SCRIPT `
-AppExePath "./releases/net481/$env:TOOL_EXE" `
-UpdaterExePath "./releases/net481/$env:UPDATER_EXE" `
-EmbeddedTrustCertPath "$env:EMBEDDED_TRUST_CERT" `
-Origin "$env:ORIGIN_BASE" `
-SftpBasePath "$env:SFTP_BASE_PATH" `
-Branch "$env:BRANCH_NAME" `
-SigningPfxBase64 "${{ secrets.UPDATER_SIGNING_PFX_B64 }}" `
-SigningPfxPassword "${{ secrets.UPDATER_SIGNING_PFX_PASSWORD }}" `
-SftpHost "republicatwar.com" `
-SftpPort 1579 `
-SftpUser "${{ secrets.SFTP_USER }}" `
-SftpPassword "${{ secrets.SFTP_PASSWORD }}" `
-NextOrigin "$env:NEXT_ORIGIN_BASE" `
-NextSftpBasePath "$env:NEXT_SFTP_BASE_PATH" `
-CompatibilityUpdaterExePath "$env:COMPAT_UPDATER"

- uses: dotnet/nbgv@v0.4.2
- uses: dotnet/nbgv@v0.5.1
id: nbgv
- name: Create GitHub release
# Only create a release on push to main
if: |
github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
name: v${{ steps.nbgv.outputs.SemVer2 }}
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-dotnet@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build in Release Mode
run: dotnet build --configuration Release
run: dotnet test --configuration Release --report-github
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,6 @@ FodyWeavers.xsd
*.sln.iml


dev/*
dev/*

.local_deploy/
13 changes: 7 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.9.50</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.300" PrivateAssets="All"/>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.9.50</Version>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion ModVerify
Submodule ModVerify updated 332 files
2 changes: 1 addition & 1 deletion ModdingToolBase
Submodule ModdingToolBase updated 208 files
9 changes: 8 additions & 1 deletion RawDevTools.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.4.11519.219 insiders
VisualStudioVersion = 18.4.11519.219
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevLauncher", "src\DevLauncher\DevLauncher.csproj", "{1BA491BC-2CD6-4270-9573-5FF9529D8D89}"
EndProject
Expand Down Expand Up @@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppUpdaterFramework.Attribu
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ApplicationBase.Shared", "ModdingToolBase\src\AnakinApps\ApplicationBase.Shared\ApplicationBase.Shared.shproj", "{B297A13A-8E3A-436C-BA97-8B5F57827FFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.StarWarsGame.Engine.FileSystem", "ModVerify\src\PetroglyphTools\PG.StarWarsGame.Engine.FileSystem\PG.StarWarsGame.Engine.FileSystem.csproj", "{679DA7CA-B23B-7160-B6CD-420BD9CD2312}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -139,6 +141,10 @@ Global
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Release|Any CPU.Build.0 = Release|Any CPU
{679DA7CA-B23B-7160-B6CD-420BD9CD2312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{679DA7CA-B23B-7160-B6CD-420BD9CD2312}.Debug|Any CPU.Build.0 = Debug|Any CPU
{679DA7CA-B23B-7160-B6CD-420BD9CD2312}.Release|Any CPU.ActiveCfg = Release|Any CPU
{679DA7CA-B23B-7160-B6CD-420BD9CD2312}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -164,6 +170,7 @@ Global
{8768819D-B0C2-4487-3B3A-84A90F36BAB7} = {46DB413A-0F73-48A6-9071-9C38916BE6FC}
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{B297A13A-8E3A-436C-BA97-8B5F57827FFE} = {46DB413A-0F73-48A6-9071-9C38916BE6FC}
{679DA7CA-B23B-7160-B6CD-420BD9CD2312} = {FF4C3704-0C74-40B5-A38D-AF29B6385D85}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DC15751A-BB36-4EF1-BFF0-2DF1E419AC8F}
Expand Down
49 changes: 49 additions & 0 deletions deploy-local.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
param(
[string]$InstalledVersion = "0.0.1-local",
[string]$ServerVersion = "99.99.99-local",
[switch]$DualPublish,
[string]$CompatibilityUpdater
)

$ErrorActionPreference = "Stop"

$root = $PSScriptRoot
if ([string]::IsNullOrEmpty($root)) { $root = Get-Location }

. (Join-Path $root "ModdingToolBase\scripts\NbgvVersion.ps1")

$deployRoot = Join-Path $root ".local_deploy"
$installBuildDir = Join-Path $deployRoot "bin\install"
$serverBuildDir = Join-Path $deployRoot "bin\tool"

$toolProj = Join-Path $root "src\DevLauncher\DevLauncher.csproj"
$baseScript = Join-Path $root "ModdingToolBase\scripts\Publish-LocalRelease.ps1"

if (Test-Path $deployRoot) { Remove-Item -Recurse -Force $deployRoot }
New-Item -ItemType Directory -Path $deployRoot | Out-Null

$nbgv = Backup-NbgvVersion -RepoRoot $root
try {
Write-Host "--- Building DevLauncher (net481) @ installed v$InstalledVersion ---" -ForegroundColor Cyan
Set-NbgvVersion -Snapshot $nbgv -Version $InstalledVersion
dotnet build $toolProj --configuration Release -f net481 --output $installBuildDir /p:DebugType=None /p:DebugSymbols=false /p:LocalDeploy=true

Write-Host "--- Building DevLauncher (net481) @ server v$ServerVersion ---" -ForegroundColor Cyan
Set-NbgvVersion -Snapshot $nbgv -Version $ServerVersion
dotnet build $toolProj --configuration Release -f net481 --output $serverBuildDir /p:DebugType=None /p:DebugSymbols=false /p:LocalDeploy=true

$publishParams = @{
AppExePath = Join-Path $serverBuildDir "RaW-DevLauncher.exe"
UpdaterExePath = Join-Path $serverBuildDir "AnakinRaW.ExternalUpdater.exe"
DeployRoot = $deployRoot
InstallBuildDir = $installBuildDir
Branch = "beta"
}
if ($DualPublish) { $publishParams.DualPublish = $true }
if ($CompatibilityUpdater) { $publishParams.CompatibilityUpdater = $CompatibilityUpdater }

& $baseScript @publishParams
}
finally {
Restore-NbgvVersion -Snapshot $nbgv
}
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
21 changes: 13 additions & 8 deletions src/DevLauncher.Tests/DevLauncher.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net481</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<IsTestable>true</IsTestable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="8.0.0">
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="Testably.Abstractions.Testing" Version="5.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="Microsoft.Testing.Platform" Version="2.2.3" />
<PackageReference Include="Testably.Abstractions.Testing" Version="6.4.0" />
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Loading