CIs: Start bundling the plugin with ASF

This commit is contained in:
JustArchi 2020-06-13 14:45:41 +02:00
parent 460689841a
commit 88b4856fe1
3 changed files with 90 additions and 21 deletions

View file

@ -10,6 +10,7 @@ env:
NET_CORE_VERSION: netcoreapp3.1
NET_FRAMEWORK_VERSION: net48
NODE_JS_VERSION: 12
STEAM_TOKEN_DUMPER_NAME: ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
jobs:
build:
@ -51,21 +52,31 @@ jobs:
run: npm run-script build:ci --no-progress --prefix ASF-ui
- name: Build ArchiSteamFarm
run: dotnet build ArchiSteamFarm -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo
run: dotnet build ArchiSteamFarm -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Build ArchiSteamFarm.CustomPlugins.ExamplePlugin
run: dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo
run: dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Build ArchiSteamFarm.CustomPlugins.PeriodicGC
run: dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo
run: dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
run: dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Run ArchiSteamFarm.Tests
run: dotnet test ArchiSteamFarm.Tests -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo
run: dotnet test ArchiSteamFarm.Tests -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Perform cleanup in preparation for publishing
run: dotnet clean ArchiSteamFarm -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo
- name: Publish ArchiSteamFarm.OfficialPlugins.SteamTokenDumper for .NET Core
run: dotnet publish "${{ env.STEAM_TOKEN_DUMPER_NAME }}" -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -o "out/${{ env.STEAM_TOKEN_DUMPER_NAME }}/${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo
- name: Restore packages in preparation for publishing
- name: Publish ArchiSteamFarm.OfficialPlugins.SteamTokenDumper for .NET Framework
if: startsWith(matrix.os, 'windows-')
run: dotnet publish "${{ env.STEAM_TOKEN_DUMPER_NAME }}" -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_FRAMEWORK_VERSION }}" -o "out/${{ env.STEAM_TOKEN_DUMPER_NAME }}/${{ env.NET_FRAMEWORK_VERSION }}" -p:UseAppHost=false --nologo
- name: Perform cleanup of ArchiSteamFarm in preparation for publishing
run: dotnet clean ArchiSteamFarm -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Restore packages in preparation for ArchiSteamFarm publishing
run: dotnet restore ArchiSteamFarm
- name: Publish ArchiSteamFarm on Unix
@ -85,11 +96,17 @@ jobs:
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${1}" "-p:ASFVariant=$1" --no-restore --nologo $variantArgs
# If we include any overlay for this variant, copy it to output directory
# If we're including any overlay for this variant, copy it to output directory
if [ -d "ArchiSteamFarm/overlay/${1}" ]; then
cp "ArchiSteamFarm/overlay/${1}/"* "out/${1}"
fi
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then
mkdir -p "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
fi
# Include .ico file for all platforms, since only Windows script can bundle it inside the exe
cp "resources/ASF.ico" "out/${1}/ArchiSteamFarm.ico"
@ -154,11 +171,20 @@ jobs:
throw "Last command failed."
}
# If we include any overlay for this variant, copy it output directory
# If we're including any overlay for this variant, copy it to output directory
if (Test-Path "ArchiSteamFarm\overlay\$variant" -PathType Container) {
Copy-Item "ArchiSteamFarm\overlay\$variant\*" "out\$variant"
}
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" -PathType Leaf) {
if (!(Test-Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -PathType Container)) {
New-Item -ItemType Directory -Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" > $null
}
Copy-Item "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME"
}
# Until https://github.com/dotnet/cli/issues/3267 happens, we'll hack dotnet binary icon on Windows and include .ico file on other platforms
if ($targetFramework -ne "$env:NET_FRAMEWORK_VERSION") {
if (!(Test-Path "out\$variant\ArchiSteamFarm.exe" -PathType Leaf)) {

View file

@ -16,6 +16,7 @@ env:
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
- NET_CORE_VERSION: netcoreapp3.1
- STEAM_TOKEN_DUMPER_NAME: ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
- VARIANTS="generic linux-arm linux-arm64 linux-x64 osx-x64 win-x64" # NOTE: When modifying variants, don't forget to update ASF_VARIANT definitions in SharedInfo.cs!
addons:
homebrew:
@ -34,12 +35,15 @@ script:
npm ci --no-progress --prefix ASF-ui
npm run-script deploy --no-progress --prefix ASF-ui
dotnet build ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet test ArchiSteamFarm.Tests -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet test ArchiSteamFarm.Tests -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet publish "$STEAM_TOKEN_DUMPER_NAME" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:UseAppHost=false --nologo
dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -p:UseAppHost=false --nologo
dotnet restore ArchiSteamFarm
publish() {
@ -51,11 +55,17 @@ script:
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${1}" "-p:ASFVariant=$1" --no-restore --nologo $variantArgs
# If we include any overlay for this variant, copy it to output directory
# If we're including any overlay for this variant, copy it to output directory
if [ -d "ArchiSteamFarm/overlay/${1}" ]; then
cp "ArchiSteamFarm/overlay/${1}/"* "out/${1}"
fi
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if [ -f "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" ]; then
mkdir -p "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
cp "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}/${STEAM_TOKEN_DUMPER_NAME}.dll" "out/${1}/plugins/${STEAM_TOKEN_DUMPER_NAME}"
fi
# Include .ico file for all platforms, since only Windows script can bundle it inside the exe
cp "resources/ASF.ico" "out/${1}/ArchiSteamFarm.ico"

View file

@ -16,6 +16,7 @@ environment:
NET_CORE_VERSION: netcoreapp3.1
NET_FRAMEWORK_VERSION: net48
NODE_JS_VERSION: lts
STEAM_TOKEN_DUMPER_NAME: ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
STEAM_TOKEN_DUMPER_TOKEN:
secure: uttQUE9ZK7BIa9SIbDkpUTMx7Slnl3zAPkRNzE465YgwxLdLEwv6yYR5QXCSZolb5Qq23Z/LmZNGd3M6B0+hbx3waWOeW2AiWvfCcnUmuT+3wfLJsgLbf1g4agFS7zsDgeRPfnNMzOxD8etelnA5YOOUMNB3RLw3fIdznNd+Fs6R0Ou3/1UavDuHKkbh1+A5
VARIANTS: generic generic-netf linux-arm linux-arm64 linux-x64 osx-x64 win-x64 # NOTE: When modifying variants, don't forget to update ASF_VARIANT definitions in SharedInfo.cs!
@ -102,7 +103,7 @@ build_script:
}
dotnet build ArchiSteamFarm -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
@ -110,7 +111,7 @@ build_script:
}
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
@ -118,7 +119,15 @@ build_script:
}
dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet build ArchiSteamFarm.CustomPlugins.PeriodicGC -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
@ -133,7 +142,7 @@ test_script:
$ProgressPreference = 'SilentlyContinue'
dotnet test ArchiSteamFarm.Tests -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet test ArchiSteamFarm.Tests -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
@ -148,7 +157,22 @@ after_test:
$ProgressPreference = 'SilentlyContinue'
dotnet clean ArchiSteamFarm -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo
dotnet publish "$env:STEAM_TOKEN_DUMPER_NAME" -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -o "out/$env:STEAM_TOKEN_DUMPER_NAME/$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
dotnet publish "$env:STEAM_TOKEN_DUMPER_NAME" -c "$env:CONFIGURATION" -f "$env:NET_FRAMEWORK_VERSION" -o "out/$env:STEAM_TOKEN_DUMPER_NAME/$env:NET_FRAMEWORK_VERSION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
dotnet clean ArchiSteamFarm -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
@ -191,11 +215,20 @@ after_test:
throw "Last command failed."
}
# If we include any overlay for this variant, copy it output directory
# If we're including any overlay for this variant, copy it to output directory
if (Test-Path "ArchiSteamFarm\overlay\$variant" -PathType Container) {
Copy-Item "ArchiSteamFarm\overlay\$variant\*" "out\$variant"
}
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" -PathType Leaf) {
if (!(Test-Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -PathType Container)) {
New-Item -ItemType Directory -Path "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" > $null
}
Copy-Item "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework\$env:STEAM_TOKEN_DUMPER_NAME.dll" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME"
}
# Until https://github.com/dotnet/cli/issues/3267 happens, we'll hack dotnet binary icon on Windows and include .ico file on other platforms
if ($targetFramework -ne "$env:NET_FRAMEWORK_VERSION") {
if (!(Test-Path "out\$variant\ArchiSteamFarm.exe" -PathType Leaf)) {