Skip to content

Commit 8704280

Browse files
committed
update to new release ci
1 parent 901b5ff commit 8704280

7 files changed

Lines changed: 99 additions & 225 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,34 @@ on:
1212
required: true
1313

1414
env:
15-
TOOL_PROJ_PATH: ./src/ModVerify.CliApp/ModVerify.CliApp.csproj
16-
PUBLISH_SCRIPT: ./modules/ModdingToolBase/scripts/Publish-Release.ps1
17-
TOOL_EXE: ModVerify.exe
18-
UPDATER_EXE: AnakinRaW.ExternalUpdater.exe
19-
EMBEDDED_TRUST_CERT: src/ModVerify.CliApp/Resources/Certs/AET-root.cer
20-
ORIGIN_BASE: https://republicatwar.com/downloads/ModVerify
21-
SFTP_BASE_PATH: downloads/ModVerify/
15+
# Per-run release channel. Every other per-app value lives in update-tooling.jsonc and is loaded
16+
# into the environment by the "Load app config" step in each job below.
2217
BRANCH_NAME: ${{ github.event.inputs.branch || 'stable' }}
2318

24-
# Migration-release values. Leave empty for a normal release; populate to enable.
25-
#
26-
# Origin URL of the next-generation channel, written into the manifest's componentOriginInfo.
27-
NEXT_ORIGIN_BASE: https://republicatwar.com/downloads/ModVerify/v2
28-
29-
# SFTP path the next-generation channel uploads to. Set together with NEXT_ORIGIN_BASE.
30-
NEXT_SFTP_BASE_PATH: downloads/ModVerify/v2/
31-
32-
# Previously-deployed updater used in place of the build-output one for the primary deploy.
33-
# Only the old-gen manifest lists this binary; the next-gen manifest still uses the build-output updater.
34-
# Requires NEXT_ORIGIN_BASE + NEXT_SFTP_BASE_PATH to be set.
35-
COMPAT_UPDATER: tools/v1/AnakinRaW.ExternalUpdater.exe
36-
3719
jobs:
3820

3921
# Builds and tests the solution.
4022
test:
4123
uses: ./.github/workflows/test.yml
4224

43-
# End-to-end self-update test (single-channel + dual-channel via /v2/).
25+
# End-to-end self-update test.
4426
integration-test:
27+
name: Integration test
4528
needs: [test]
46-
uses: ./.github/workflows/integration-test.yml
29+
runs-on: windows-latest
30+
steps:
31+
- uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
34+
submodules: recursive
35+
- uses: actions/setup-dotnet@v5
36+
with:
37+
dotnet-version: 10.0.x
38+
- name: Run self-update integration suite
39+
shell: pwsh
40+
run: |
41+
$c = Get-Content -Raw ./update-tooling.jsonc | ConvertFrom-Json
42+
& "$($c.scriptsDir)/Test-LocalUpdateSuite.ps1" -ConfigPath ./update-tooling.jsonc
4743
4844
pack:
4945
name: Pack
@@ -55,6 +51,11 @@ jobs:
5551
with:
5652
fetch-depth: 0
5753
submodules: recursive
54+
- name: Load app config
55+
shell: pwsh
56+
run: |
57+
$c = Get-Content -Raw ./update-tooling.jsonc | ConvertFrom-Json
58+
"TOOL_PROJ_PATH=$($c.toolProject)" >> $env:GITHUB_ENV
5859
- name: Setup .NET
5960
uses: actions/setup-dotnet@v5
6061
- name: Create NetFramework Release
@@ -97,6 +98,23 @@ jobs:
9798
with:
9899
dotnet-version: 10.0.x
99100

101+
- name: Load app config
102+
shell: pwsh
103+
# Per-app release values come from update-tooling.jsonc.
104+
run: |
105+
$c = Get-Content -Raw ./update-tooling.jsonc | ConvertFrom-Json
106+
"PUBLISH_SCRIPT=$($c.scriptsDir)/Publish-Release.ps1" >> $env:GITHUB_ENV
107+
"TOOL_EXE=$($c.appExe)" >> $env:GITHUB_ENV
108+
"UPDATER_EXE=$($c.updaterExe)" >> $env:GITHUB_ENV
109+
"EMBEDDED_TRUST_CERT=$($c.embeddedTrustCert)" >> $env:GITHUB_ENV
110+
"ORIGIN_BASE=$($c.origin)" >> $env:GITHUB_ENV
111+
"SFTP_BASE_PATH=$($c.sftpBasePath)" >> $env:GITHUB_ENV
112+
"SFTP_HOST=$($c.sftpHost)" >> $env:GITHUB_ENV
113+
"SFTP_PORT=$($c.sftpPort)" >> $env:GITHUB_ENV
114+
"NEXT_ORIGIN_BASE=$($c.nextOrigin)" >> $env:GITHUB_ENV
115+
"NEXT_SFTP_BASE_PATH=$($c.nextSftpBasePath)" >> $env:GITHUB_ENV
116+
"COMPAT_UPDATER=$($c.compatUpdater)" >> $env:GITHUB_ENV
117+
100118
- name: Publish self-update release
101119
shell: pwsh
102120
run: |
@@ -135,5 +153,5 @@ jobs:
135153
token: ${{ secrets.GITHUB_TOKEN }}
136154
generate_release_notes: true
137155
files: |
138-
./releases/net481/ModVerify.exe
156+
./releases/net481/${{ env.TOOL_EXE }}
139157
./releases/ModVerify-Net10.zip

.github/workflows/test.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,21 @@ jobs:
4242
dotnet build --configuration Release
4343
for proj in $(find . -name '*.Test.csproj' -not -path '*/ExternalUpdater.App.Test/*'); do
4444
dotnet test "$proj" --no-build --configuration Release --report-github
45-
done
45+
done
46+
47+
test-moddingtoolbase:
48+
name: Test ModdingToolBase
49+
runs-on: windows-latest
50+
steps:
51+
- uses: actions/checkout@v6
52+
with:
53+
fetch-depth: 0
54+
submodules: recursive
55+
- uses: actions/setup-dotnet@v5
56+
with:
57+
dotnet-version: 10.0.x
58+
- name: Test ModdingToolBase (submodule)
59+
shell: pwsh
60+
run: |
61+
$c = Get-Content -Raw ./update-tooling.jsonc | ConvertFrom-Json
62+
& "$($c.scriptsDir)/Test-ModdingToolBase.ps1"

deploy-local.ps1

Lines changed: 0 additions & 67 deletions
This file was deleted.

test-local-update-dual.ps1

Lines changed: 0 additions & 54 deletions
This file was deleted.

test-local-update.ps1

Lines changed: 0 additions & 37 deletions
This file was deleted.

update-tooling.jsonc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Per-app configuration for the shared ModdingToolBase release/deploy tooling.
2+
// Consumed by ModdingToolBase/scripts/*.ps1 (local dev/test) and by .github/workflows/release.yml (CI).
3+
//
4+
// Parsed only with PowerShell's ConvertFrom-Json, which tolerates // and /* */ comments and
5+
// trailing commas. Keep it that way: don't point a strict JSON validator at this file.
6+
{
7+
// ===== SHARED -- consumed by BOTH dev/test (local scripts) and prod (release.yml CI) =======
8+
"toolProject": "./src/ModVerify.CliApp/ModVerify.CliApp.csproj", // app csproj to build
9+
"appExe": "ModVerify.exe", // built app exe name
10+
"updaterExe": "AnakinRaW.ExternalUpdater.exe", // external updater exe name
11+
"scriptsDir": "./modules/ModdingToolBase/scripts", // ModdingToolBase scripts dir (its submodule path)
12+
13+
// ===== DEV/TEST ONLY -- the local self-update test scripts; never used by a prod release ===
14+
// testUpdateBranch: the update-server channel the local test publishes to and reads from
15+
// (feeds --updateBranch). It's an update channel, NOT a git branch; prod uses "stable"
16+
// (set in release.yml's BRANCH_NAME). Note what is NOT here:
17+
// - targetFramework: fixed at net481 by the tooling (external updater is net481-only),
18+
// so it's a Build-LocalRelease.ps1 default, not a per-app value.
19+
// - noUpdateMessage: the test now asserts the re-check exits 0 and leaves the exe version
20+
// unchanged, instead of scraping a host-specific console string.
21+
"testUpdateBranch": "beta",
22+
"appLogDir": "ModVerify", // %APPDATA% subfolder with the app log (failure diagnostics)
23+
24+
// ===== PROD / RELEASE ONLY -- published by release.yml (CI); unused by the local test ======
25+
"embeddedTrustCert": "src/ModVerify.CliApp/Resources/Certs/AET-root.cer", // public trust .cer shipped in the app
26+
"origin": "https://republicatwar.com/downloads/ModVerify", // manifest origin URL
27+
"sftpBasePath": "downloads/ModVerify", // SFTP upload base path
28+
"sftpHost": "republicatwar.com",
29+
"sftpPort": 1579,
30+
31+
// Migration release (cross-API). Leave all three empty for a normal release; populate them to
32+
// publish a next-generation channel alongside the current one. See Publish-Release.ps1.
33+
// nextOrigin - origin URL of the next-gen channel
34+
// nextSftpBasePath - SFTP base path for the next-gen channel (set together with nextOrigin)
35+
// compatUpdater - previous-gen updater used for the PRIMARY deploy during the cutover
36+
// (only valid when nextOrigin + nextSftpBasePath are set)
37+
"nextOrigin": "https://republicatwar.com/downloads/ModVerify/v2",
38+
"nextSftpBasePath": "downloads/ModVerify/v2",
39+
"compatUpdater": "tools/v1/AnakinRaW.ExternalUpdater.exe"
40+
}

0 commit comments

Comments
 (0)