Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9aa0f23a8e | ||
|
|
6063217343 | ||
|
|
0614aa6526 |
+101
-3
@@ -1,5 +1,7 @@
|
|||||||
name: Mod Build
|
name: Mod Build
|
||||||
on: push
|
on:
|
||||||
|
- push
|
||||||
|
- workflow_dispatch
|
||||||
env:
|
env:
|
||||||
MOD_NAME: "RefinedRDApi"
|
MOD_NAME: "RefinedRDApi"
|
||||||
MOD_ID: "7q2RnptXynYzEX"
|
MOD_ID: "7q2RnptXynYzEX"
|
||||||
@@ -24,7 +26,7 @@ jobs:
|
|||||||
echo "Engine Directory: ${{env.ENGINE_DIR}}"
|
echo "Engine Directory: ${{env.ENGINE_DIR}}"
|
||||||
echo "Built Mods Directory: ${{env.BUILT_MODS_DIR}}"
|
echo "Built Mods Directory: ${{env.BUILT_MODS_DIR}}"
|
||||||
echo "Dev Build Directory: ${{env.DEV_BUILDS_DIR}}"
|
echo "Dev Build Directory: ${{env.DEV_BUILDS_DIR}}"
|
||||||
echo "Change Log: ${{vars.CHANGELOG}}"
|
echo "Change Log: auto-generated from commits since last release/* tag"
|
||||||
|
|
||||||
Build:
|
Build:
|
||||||
runs-on: windows-ue
|
runs-on: windows-ue
|
||||||
@@ -33,6 +35,7 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{steps.version.outputs.version}}
|
version: ${{steps.version.outputs.version}}
|
||||||
|
changelog_b64: ${{steps.changelog.outputs.changelog_b64}}
|
||||||
steps:
|
steps:
|
||||||
- name: Compute Version
|
- name: Compute Version
|
||||||
id: version
|
id: version
|
||||||
@@ -109,6 +112,79 @@ jobs:
|
|||||||
}
|
}
|
||||||
echo "Pulled ${{env.MOD_NAME}} @ latest (${{gitea.ref_name}})"
|
echo "Pulled ${{env.MOD_NAME}} @ latest (${{gitea.ref_name}})"
|
||||||
|
|
||||||
|
- name: Generate Changelog
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
$modPath = "${{env.SML_DIR}}/Mods/${{env.MOD_NAME}}"
|
||||||
|
if ("${{env.IS_GAME_FEATURE_PLUGIN}}" -eq "true") {
|
||||||
|
$modPath = "${{env.SML_DIR}}/Mods/GameFeatures/${{env.MOD_NAME}}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Last commit that was actually released to SMR is marked by a release/* tag
|
||||||
|
# pushed by the SMRDeploy job. No manual tagging, no manual changelog.
|
||||||
|
$prevTag = (git -C $modPath describe --tags --abbrev=0 --match "release/*" HEAD 2>$null)
|
||||||
|
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($prevTag)) {
|
||||||
|
$prevTag = $null
|
||||||
|
$range = "HEAD"
|
||||||
|
echo "No previous release/* tag found - using full history"
|
||||||
|
} else {
|
||||||
|
$range = "$prevTag..HEAD"
|
||||||
|
echo "Previous release tag: $prevTag"
|
||||||
|
}
|
||||||
|
|
||||||
|
$subjects = @(git -C $modPath log --no-merges --pretty=format:%s $range) |
|
||||||
|
Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
|
||||||
|
|
||||||
|
$groups = [ordered]@{
|
||||||
|
"Features" = @()
|
||||||
|
"Fixes" = @()
|
||||||
|
"Performance" = @()
|
||||||
|
"Changes" = @()
|
||||||
|
"Other" = @()
|
||||||
|
}
|
||||||
|
# Commit types that are noise for players - never shown
|
||||||
|
$skip = @("chore", "ci", "docs", "test", "tests", "style", "build")
|
||||||
|
|
||||||
|
foreach ($subject in $subjects) {
|
||||||
|
if ($subject -match '^(?<type>[a-zA-Z]+)(\([^)]*\))?!?:\s*(?<desc>.+)$') {
|
||||||
|
$type = $matches.type.ToLower()
|
||||||
|
$desc = $matches.desc.Trim()
|
||||||
|
if ($skip -contains $type) { continue }
|
||||||
|
switch ($type) {
|
||||||
|
"feat" { $groups["Features"] += $desc }
|
||||||
|
"fix" { $groups["Fixes"] += $desc }
|
||||||
|
"perf" { $groups["Performance"] += $desc }
|
||||||
|
"refactor" { $groups["Changes"] += $desc }
|
||||||
|
default { $groups["Other"] += $desc }
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$groups["Other"] += $subject.Trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$lines = @()
|
||||||
|
foreach ($name in $groups.Keys) {
|
||||||
|
$items = $groups[$name] | Select-Object -Unique
|
||||||
|
if ($items.Count -eq 0) { continue }
|
||||||
|
$lines += "### $name"
|
||||||
|
foreach ($item in $items) { $lines += "- $item" }
|
||||||
|
$lines += ""
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($lines.Count -eq 0) {
|
||||||
|
$lines = @("### Changes", "- Maintenance release")
|
||||||
|
}
|
||||||
|
|
||||||
|
$header = @("# Change Log - v${{steps.version.outputs.version}}", "")
|
||||||
|
$changelog = (($header + $lines) -join "`n").Trim()
|
||||||
|
echo "----- Changelog -----"
|
||||||
|
echo $changelog
|
||||||
|
echo "---------------------"
|
||||||
|
|
||||||
|
# base64 so the multiline markdown survives job outputs intact
|
||||||
|
$b64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($changelog))
|
||||||
|
Write-Output "changelog_b64=$b64" >> $Env:GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Update UPlugin Versions
|
- name: Update UPlugin Versions
|
||||||
run: |
|
run: |
|
||||||
$newVersion = "${{steps.version.outputs.version}}"
|
$newVersion = "${{steps.version.outputs.version}}"
|
||||||
@@ -213,9 +289,13 @@ jobs:
|
|||||||
path: ${{env.BUILT_MODS_DIR}}
|
path: ${{env.BUILT_MODS_DIR}}
|
||||||
|
|
||||||
- name: Deploy to SMR
|
- name: Deploy to SMR
|
||||||
|
id: deploy
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying to SMR"
|
echo "Deploying to SMR"
|
||||||
$Version = "${{needs.Build.outputs.version}}"
|
$Version = "${{needs.Build.outputs.version}}"
|
||||||
|
$Changelog = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("${{needs.Build.outputs.changelog_b64}}"))
|
||||||
|
echo "Changelog:"
|
||||||
|
echo $Changelog
|
||||||
$query = '{ "query": "query { getModByReference(modReference:\"${{env.MOD_NAME}}\"){ versions(filter:{limit: 1}){ version } }}"}'
|
$query = '{ "query": "query { getModByReference(modReference:\"${{env.MOD_NAME}}\"){ versions(filter:{limit: 1}){ version } }}"}'
|
||||||
$SMRVersion = (Invoke-RestMethod `
|
$SMRVersion = (Invoke-RestMethod `
|
||||||
-Method POST `
|
-Method POST `
|
||||||
@@ -232,5 +312,23 @@ jobs:
|
|||||||
& "S:/ficsit_windows_amd64.exe" smr upload `
|
& "S:/ficsit_windows_amd64.exe" smr upload `
|
||||||
--api-base "$APIURL" `
|
--api-base "$APIURL" `
|
||||||
--api-key "${{secrets.FICSIT_TOKEN}}" `
|
--api-key "${{secrets.FICSIT_TOKEN}}" `
|
||||||
"${{env.MOD_ID}}" "$File" "${{vars.CHANGELOG}}"
|
"${{env.MOD_ID}}" "$File" "$Changelog"
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Error "SMR upload failed"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
Write-Output "uploaded=true" >> $Env:GITHUB_OUTPUT
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
|
- name: Tag Released Commit
|
||||||
|
if: ${{ steps.deploy.outputs.uploaded == 'true' }}
|
||||||
|
run: |
|
||||||
|
$Version = "${{needs.Build.outputs.version}}"
|
||||||
|
$modPath = "${{env.SML_DIR}}/Mods/${{env.MOD_NAME}}"
|
||||||
|
if ("${{env.IS_GAME_FEATURE_PLUGIN}}" -eq "true") {
|
||||||
|
$modPath = "${{env.SML_DIR}}/Mods/GameFeatures/${{env.MOD_NAME}}"
|
||||||
|
}
|
||||||
|
# This tag is the marker the next build's changelog starts from
|
||||||
|
git -C $modPath tag -f "release/$Version"
|
||||||
|
git -C $modPath push -f origin "release/$Version"
|
||||||
|
echo "Tagged release/$Version @ $(git -C $modPath rev-parse HEAD)"
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"FileVersion": 3,
|
"FileVersion": 3,
|
||||||
"Version": 1,
|
"Version": 2026,
|
||||||
"VersionName": "1.0.7",
|
"VersionName": "2026.3.2",
|
||||||
"SemVersion": "1.0.7",
|
"SemVersion": "2026.3.2",
|
||||||
"FriendlyName": "Refined R&D Api",
|
"FriendlyName": "Refined R&D Api",
|
||||||
"Description": "This Lib can be used to create Mod Compatability with Refined R&D Mods",
|
"Description": "This Lib can be used to create Mod Compatability with Refined R&D Mods",
|
||||||
"Category": "Modding",
|
"Category": "Modding",
|
||||||
|
|||||||
@@ -408,7 +408,8 @@ TArray<URRDATurbineDataAsset*> URRDADataAssetSubsystem::GetAllTurbineAssets(int3
|
|||||||
}
|
}
|
||||||
|
|
||||||
URRDATurbineDataAsset* URRDADataAssetSubsystem::GetDefaultTurbineAsset(int32 Tier) const {
|
URRDATurbineDataAsset* URRDADataAssetSubsystem::GetDefaultTurbineAsset(int32 Tier) const {
|
||||||
return GetAllTurbineAssets(Tier).Top();
|
TArray<URRDATurbineDataAsset*> Assets = GetAllTurbineAssets(Tier);
|
||||||
|
return Assets.Num() > 0 ? Assets.Top() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
URRDATurbineDataAsset* URRDADataAssetSubsystem::GetTurbineItemData(TSubclassOf<UFGItemDescriptor> Item, int32 Tier) const {
|
URRDATurbineDataAsset* URRDADataAssetSubsystem::GetTurbineItemData(TSubclassOf<UFGItemDescriptor> Item, int32 Tier) const {
|
||||||
@@ -435,7 +436,8 @@ URRDACoolerDataAsset* URRDADataAssetSubsystem::GetCoolerItemData(TSubclassOf<UFG
|
|||||||
}
|
}
|
||||||
|
|
||||||
URRDACoolerDataAsset* URRDADataAssetSubsystem::GetDefaultCoolerAsset(ERRDACoolerType Type) const {
|
URRDACoolerDataAsset* URRDADataAssetSubsystem::GetDefaultCoolerAsset(ERRDACoolerType Type) const {
|
||||||
return GetAllCoolerAssets(Type).Top();
|
TArray<URRDACoolerDataAsset*> Assets = GetAllCoolerAssets(Type);
|
||||||
|
return Assets.Num() > 0 ? Assets.Top() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<URRDACoolerDataAsset*> URRDADataAssetSubsystem::GetAllCoolerAssets(ERRDACoolerType Type) const {
|
TArray<URRDACoolerDataAsset*> URRDADataAssetSubsystem::GetAllCoolerAssets(ERRDACoolerType Type) const {
|
||||||
@@ -481,7 +483,8 @@ bool URRDADataAssetSubsystem::GetAllBoilerRelevantItems(TArray<TSubclassOf<UFGIt
|
|||||||
}
|
}
|
||||||
|
|
||||||
URRDABoilerDataAsset* URRDADataAssetSubsystem::GetDefaultBoilerAsset(int32 Tier) const {
|
URRDABoilerDataAsset* URRDADataAssetSubsystem::GetDefaultBoilerAsset(int32 Tier) const {
|
||||||
return GetAllBoilerAssets(Tier).Top();
|
TArray<URRDABoilerDataAsset*> Assets = GetAllBoilerAssets(Tier);
|
||||||
|
return Assets.Num() > 0 ? Assets.Top() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<URRDABoilerDataAsset*> URRDADataAssetSubsystem::GetAllBoilerAssets(int32 Tier) const {
|
TArray<URRDABoilerDataAsset*> URRDADataAssetSubsystem::GetAllBoilerAssets(int32 Tier) const {
|
||||||
@@ -522,7 +525,8 @@ bool URRDADataAssetSubsystem::GetAllHeaterRelevantItems(TArray<TSubclassOf<UFGIt
|
|||||||
}
|
}
|
||||||
|
|
||||||
URRDAHeaterDataAsset* URRDADataAssetSubsystem::GetDefaultHeaterAsset(ERRDAHeaterType Type) const {
|
URRDAHeaterDataAsset* URRDADataAssetSubsystem::GetDefaultHeaterAsset(ERRDAHeaterType Type) const {
|
||||||
return GetAllHeaterAssets(Type).Top();
|
TArray<URRDAHeaterDataAsset*> Assets = GetAllHeaterAssets(Type);
|
||||||
|
return Assets.Num() > 0 ? Assets.Top() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<URRDAHeaterDataAsset*> URRDADataAssetSubsystem::GetAllHeaterAssets(ERRDAHeaterType Type) const {
|
TArray<URRDAHeaterDataAsset*> URRDADataAssetSubsystem::GetAllHeaterAssets(ERRDAHeaterType Type) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user