Implement some deduplication for overlay

Including 3 same scripts for linux is overkill, osx and linux could also be aggregated to "unix" but too much work
This commit is contained in:
Archi
2021-09-26 00:12:15 +02:00
parent c7fd08273b
commit 300c1c19ec
6 changed files with 17 additions and 170 deletions

View File

@@ -126,15 +126,21 @@ jobs:
publish() {
if [ "$1" = 'generic' ]; then
local variantArgs="-p:TargetLatestRuntimePatch=false -p:UseAppHost=false"
variantArgs="-p:TargetLatestRuntimePatch=false -p:UseAppHost=false"
else
local variantArgs="-p:PublishSingleFile=true -p:PublishTrimmed=true -r $1"
variantArgs="-p:PublishSingleFile=true -p:PublishTrimmed=true -r $1"
fi
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${1}" "-p:ASFVariant=$1" -p:ContinuousIntegrationBuild=true --no-restore --nologo $variantArgs
# If we're including any overlay for this variant, copy it to output directory
if [ -d "ArchiSteamFarm/overlay/${1}" ]; then
variant_os="$(echo "$1" | cut -d '-' -f 1)"
if [ -d "ArchiSteamFarm/overlay/${variant_os}" ]; then
cp -pR "ArchiSteamFarm/overlay/${variant_os}/"* "out/${1}"
fi
if [ "$1" != "$variant_os" ] && [ -d "ArchiSteamFarm/overlay/${1}" ]; then
cp -pR "ArchiSteamFarm/overlay/${1}/"* "out/${1}"
fi
@@ -249,7 +255,13 @@ jobs:
}
# If we're including any overlay for this variant, copy it to output directory
if (Test-Path "ArchiSteamFarm\overlay\$variant" -PathType Container) {
$variant_os = $variant.Split('-', 2)[0];
if (Test-Path "ArchiSteamFarm\overlay\$variant_os" -PathType Container) {
Copy-Item "ArchiSteamFarm\overlay\$variant_os\*" "out\$variant" -Recurse
}
if (($variant -ne $variant_os) -and (Test-Path "ArchiSteamFarm\overlay\$variant" -PathType Container)) {
Copy-Item "ArchiSteamFarm\overlay\$variant\*" "out\$variant" -Recurse
}