ArchiSteamFarm/.github/appveyor.yml

277 lines
8.6 KiB
YAML
Raw Normal View History

2017-02-23 17:50:57 +00:00
version: '{build}-{branch}'
2017-02-12 14:15:20 +00:00
pull_requests:
do_not_increment_build_number: true
2017-01-16 02:03:19 +00:00
skip_branch_with_pr: true
image: Visual Studio 2019
2016-04-20 23:09:52 +00:00
configuration: Release
clone_depth: 10
2017-06-30 01:54:48 +00:00
environment:
2021-02-22 15:20:54 +00:00
DOTNET_CHANNEL: 5.0
2017-06-30 01:54:48 +00:00
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_INSTALL_DIR: C:\Program Files\dotnet
2020-09-28 19:46:17 +00:00
DOTNET_NOLOGO: true
2021-02-22 15:20:54 +00:00
# DOTNET_SDK: 5.0.103
NET_CORE_VERSION: net5.0
2019-08-01 21:31:07 +00:00
NET_FRAMEWORK_VERSION: net48
NODE_JS_VERSION: lts
STEAM_TOKEN_DUMPER_NAME: ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
2020-06-13 10:08:21 +00:00
STEAM_TOKEN_DUMPER_TOKEN:
secure: uttQUE9ZK7BIa9SIbDkpUTMx7Slnl3zAPkRNzE465YgwxLdLEwv6yYR5QXCSZolb5Qq23Z/LmZNGd3M6B0+hbx3waWOeW2AiWvfCcnUmuT+3wfLJsgLbf1g4agFS7zsDgeRPfnNMzOxD8etelnA5YOOUMNB3RLw3fIdznNd+Fs6R0Ou3/1UavDuHKkbh1+A5
2020-04-08 17:32:53 +00:00
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!
matrix:
2018-04-17 08:59:06 +00:00
allow_failures:
- image: Visual Studio 2019 Preview
fast_finish: true
install:
- pwsh: >-
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
2019-12-18 21:09:33 +00:00
git submodule sync --recursive
2019-11-11 16:04:49 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
git submodule update --init --recursive
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
2019-11-11 16:04:49 +00:00
if ($env:DOTNET_CHANNEL) {
dotnet --info
try {
&([scriptblock]::Create((Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1'))) -Channel "$env:DOTNET_CHANNEL" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath
} catch [System.Net.WebException],[System.IO.IOException] {
# Not fatal for the remaining part of the script
Write-Host $_
}
}
if ($env:DOTNET_SDK) {
dotnet --info
try {
&([scriptblock]::Create((Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 'Current' -Version "$env:DOTNET_SDK" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath
} catch [System.Net.WebException],[System.IO.IOException] {
# Not fatal for the remaining part of the script
Write-Host $_
}
}
- ps: Install-Product node "$env:NODE_JS_VERSION"
2017-06-27 16:36:40 +00:00
before_build:
- pwsh: >-
2017-10-15 09:04:25 +00:00
Set-StrictMode -Version Latest
2017-10-15 09:45:05 +00:00
$ErrorActionPreference = 'Stop'
2017-10-15 09:45:05 +00:00
2017-10-15 09:04:25 +00:00
$ProgressPreference = 'SilentlyContinue'
2017-10-23 10:46:47 +00:00
dotnet --info
2018-05-19 19:48:26 +00:00
2019-06-01 14:03:52 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
2020-09-30 23:21:50 +00:00
node -v
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
npm -v
2019-06-01 14:03:52 +00:00
2018-05-19 19:48:26 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
2018-05-19 19:48:26 +00:00
}
build_script:
- pwsh: >-
2017-10-15 09:04:25 +00:00
Set-StrictMode -Version Latest
2017-10-15 09:45:05 +00:00
$ErrorActionPreference = 'Stop'
2017-10-15 09:45:05 +00:00
2017-10-15 09:04:25 +00:00
$ProgressPreference = 'SilentlyContinue'
2017-10-23 10:46:47 +00:00
npm ci --no-progress --prefix ASF-ui
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
npm run-script deploy --no-progress --prefix ASF-ui
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
2021-05-08 23:57:49 +00:00
dotnet build -c "$env:CONFIGURATION" -p:ContinuousIntegrationBuild=true -p:UseAppHost=false --nologo
2018-05-19 19:48:26 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
2018-05-19 19:48:26 +00:00
}
test_script:
- pwsh: >-
2017-10-15 09:04:25 +00:00
Set-StrictMode -Version Latest
2017-10-15 09:45:05 +00:00
$ErrorActionPreference = 'Stop'
2017-10-15 09:45:05 +00:00
2017-10-15 09:04:25 +00:00
$ProgressPreference = 'SilentlyContinue'
2017-10-23 10:46:47 +00:00
2021-05-08 23:57:49 +00:00
dotnet test ArchiSteamFarm.Tests -c "$env:CONFIGURATION" -p:ContinuousIntegrationBuild=true -p:UseAppHost=false --nologo
2018-05-19 19:48:26 +00:00
2018-05-19 19:48:26 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
2018-05-19 19:48:26 +00:00
}
2017-07-10 06:33:38 +00:00
after_test:
- pwsh: >-
2017-10-15 09:04:25 +00:00
Set-StrictMode -Version Latest
2017-10-15 09:45:05 +00:00
2017-06-30 05:54:18 +00:00
$ErrorActionPreference = 'Stop'
2017-10-15 09:45:05 +00:00
2017-10-15 09:04:25 +00:00
$ProgressPreference = 'SilentlyContinue'
2017-06-30 02:07:28 +00:00
2017-10-23 10:46:47 +00:00
2020-06-15 11:45:17 +00:00
if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs" -PathType Leaf)) {
(Get-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs").Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs"
2020-06-13 14:14:37 +00:00
}
2021-05-08 23:57:49 +00:00
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:ContinuousIntegrationBuild=true -p:TargetLatestRuntimePatch=false -p:UseAppHost=false --nologo
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
2021-05-08 23:57:49 +00:00
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:ContinuousIntegrationBuild=true -p:TargetLatestRuntimePatch=false -p:UseAppHost=false --nologo
2020-05-09 23:04:25 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
2021-05-08 23:57:49 +00:00
dotnet restore ArchiSteamFarm -p:ContinuousIntegrationBuild=true
2020-05-09 23:04:25 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
$PublishBlock = {
2018-06-03 07:36:23 +00:00
param($variant)
2017-07-05 01:35:09 +00:00
2017-10-15 09:04:25 +00:00
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
2017-10-15 09:04:25 +00:00
$ProgressPreference = 'SilentlyContinue'
2017-06-30 02:43:39 +00:00
Set-Location "$env:APPVEYOR_BUILD_FOLDER"
2017-07-05 01:35:09 +00:00
2018-06-03 07:36:23 +00:00
if ($variant -like '*-netf') {
$targetFramework = $env:NET_FRAMEWORK_VERSION
} else {
2018-06-03 07:36:23 +00:00
$targetFramework = $env:NET_CORE_VERSION
}
2018-06-03 07:36:23 +00:00
if ($variant -like 'generic*') {
$variantArgs = '-p:TargetLatestRuntimePatch=false', '-p:UseAppHost=false'
} else {
2020-05-15 15:43:09 +00:00
$variantArgs = '-p:PublishSingleFile=true', '-p:PublishTrimmed=true', '-r', "$variant"
}
2017-06-30 05:54:18 +00:00
2021-05-08 23:57:49 +00:00
dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -f "$targetFramework" -o "out\$variant" "-p:ASFVariant=$variant" -p:ContinuousIntegrationBuild=true --no-restore --nologo $variantArgs
2018-05-19 19:48:26 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
2018-05-19 19:48:26 +00:00
}
# If we're including any overlay for this variant, copy it to output directory
2019-01-12 01:00:19 +00:00
if (Test-Path "ArchiSteamFarm\overlay\$variant" -PathType Container) {
Copy-Item "ArchiSteamFarm\overlay\$variant\*" "out\$variant" -Recurse
2017-09-23 02:43:27 +00:00
}
# If we're including SteamTokenDumper plugin for this framework, copy it to output directory
if (Test-Path "out\$env:STEAM_TOKEN_DUMPER_NAME\$targetFramework" -PathType Container) {
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\*" "out\$variant\plugins\$env:STEAM_TOKEN_DUMPER_NAME" -Recurse
}
# Icon is available only in .NET Framework and .NET Core Windows build, we'll bundle the .ico file for other flavours
if (($targetFramework -eq "$env:NET_CORE_VERSION") -and !(Test-Path "out\$variant\ArchiSteamFarm.exe" -PathType Leaf)) {
Copy-Item 'resources\ASF.ico' "out\$variant\ArchiSteamFarm.ico"
2017-09-27 00:58:57 +00:00
}
# By default use fastest compression
$compressionArgs = '-mx=1'
# Include extra logic for builds marked for release
2017-09-26 04:30:20 +00:00
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
2017-09-28 03:07:23 +00:00
# Update link in Changelog.html accordingly
if (Test-Path "out\$variant\Changelog.html" -PathType Leaf) {
2021-01-20 20:14:45 +00:00
(Get-Content "out\$variant\Changelog.html").Replace('ArchiSteamFarm/commits/main', "ArchiSteamFarm/releases/tag/$env:APPVEYOR_REPO_TAG_NAME") | Set-Content "out\$variant\Changelog.html"
2017-09-28 03:07:23 +00:00
}
2017-09-26 04:30:20 +00:00
}
2020-04-10 17:33:31 +00:00
7z a -bd -slp -tzip -mm=Deflate $compressionArgs "out\ASF-$variant.zip" "$env:APPVEYOR_BUILD_FOLDER\out\$variant\*"
2018-05-19 19:48:26 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
2018-05-19 19:48:26 +00:00
}
# TODO: Change me to Push-AppveyorArtifact once https://github.com/appveyor/ci/issues/2183 is fixed
appveyor PushArtifact "out\ASF-$variant.zip" -FileName "ASF-$variant.zip" -DeploymentName "ASF-$variant.zip"
2017-06-30 04:18:03 +00:00
}
foreach ($variant in $env:VARIANTS.Split([char[]] $null, [System.StringSplitOptions]::RemoveEmptyEntries)) {
Start-Job -Name "$variant" $PublishBlock -ArgumentList "$variant"
}
2020-11-19 20:32:06 +00:00
Get-Job | Receive-Job -Wait
deploy: off
2017-07-15 02:45:44 +00:00
notifications:
- provider: Webhook
url:
2017-07-15 03:21:25 +00:00
secure: i/og7KzkpbcWcKoUubrLH+KB6bkfqA55FHUlGxLepLmgZNQeNMiMoAFICOFY795fFrFfUNUKqwk7ApXE6HUyWMoiijLj7G/JBLTPkBiTCu8fZMTMqwQm6FiHB3+/0h0C+ukcrBEqnXYSQUh6znpKqJSTrIfXUQ7ftNuC966kBAw=
2017-07-15 02:45:44 +00:00
method: POST
body: >-
{
"avatar_url": "https://www.appveyor.com/assets/img/appveyor-logo-256.png",
"username": "AppVeyor",
2018-09-23 01:31:47 +00:00
"content": "[{{projectName}}:{{branch}}] {{commitMessage}} by {{commitAuthor}} ({{commitId}}) | **{{status}}** on {{buildUrl}}"
2017-07-15 02:45:44 +00:00
}
on_build_success: true
on_build_failure: true
on_build_status_changed: false