mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
312 lines
12 KiB
YAML
312 lines
12 KiB
YAML
version: '{build}-{branch}'
|
|
pull_requests:
|
|
do_not_increment_build_number: true
|
|
skip_branch_with_pr: true
|
|
image: Visual Studio 2019
|
|
configuration: Release
|
|
clone_depth: 10
|
|
environment:
|
|
CROWDIN_API_KEY:
|
|
secure: oGuZaQo2z5/JkEYaKrD9Ing+TgwZ3qQVf+9Jdz73Fephy04z5rWPGCCtkjaMLTcY
|
|
CROWDIN_PROJECT_IDENTIFIER: archisteamfarm
|
|
DOTNET_CHANNEL: 3.1
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
DOTNET_INSTALL_DIR: C:\Program Files\dotnet
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
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!
|
|
matrix:
|
|
allow_failures:
|
|
- image: Visual Studio 2019 Preview
|
|
fast_finish: true
|
|
install:
|
|
- pwsh: >-
|
|
Set-StrictMode -Version Latest
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
|
|
git submodule sync --recursive
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
if ($env:DOTNET_CHANNEL) {
|
|
dotnet --info
|
|
|
|
&([scriptblock]::Create((Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1'))) -Channel "$env:DOTNET_CHANNEL" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath
|
|
}
|
|
- ps: Install-Product node "$env:NODE_JS_VERSION"
|
|
before_build:
|
|
- pwsh: >-
|
|
Set-StrictMode -Version Latest
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
|
|
dotnet --info
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
java -version
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
build_script:
|
|
- pwsh: >-
|
|
Set-StrictMode -Version Latest
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
|
|
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."
|
|
}
|
|
|
|
|
|
dotnet build ArchiSteamFarm -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
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) {
|
|
throw "Last command failed."
|
|
}
|
|
test_script:
|
|
- pwsh: >-
|
|
Set-StrictMode -Version Latest
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
|
|
dotnet test ArchiSteamFarm.Tests -c "$env:CONFIGURATION" -p:UseAppHost=false --nologo
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
after_test:
|
|
- pwsh: >-
|
|
Set-StrictMode -Version Latest
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
|
|
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) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
dotnet restore ArchiSteamFarm
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
|
|
$PublishBlock = {
|
|
param($variant)
|
|
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
Set-Location "$env:APPVEYOR_BUILD_FOLDER"
|
|
|
|
if ($variant -like '*-netf') {
|
|
$targetFramework = $env:NET_FRAMEWORK_VERSION
|
|
} else {
|
|
$targetFramework = $env:NET_CORE_VERSION
|
|
}
|
|
|
|
if ($variant -like 'generic*') {
|
|
$variantArgs = '-p:UseAppHost=false'
|
|
} else {
|
|
$variantArgs = '-p:PublishSingleFile=true', '-p:PublishTrimmed=true', '-r', "$variant"
|
|
}
|
|
|
|
dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -f "$targetFramework" -o "out\$variant" "-p:ASFVariant=$variant" --no-restore --nologo $variantArgs
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
# 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)) {
|
|
Copy-Item 'resources\ASF.ico' "out\$variant\ArchiSteamFarm.ico"
|
|
}
|
|
}
|
|
|
|
# By default use fastest compression
|
|
$compressionArgs = '-mx=1'
|
|
|
|
# Include extra logic for builds marked for release
|
|
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
|
|
# Update link in Changelog.html accordingly
|
|
if (Test-Path "out\$variant\Changelog.html" -PathType Leaf) {
|
|
(Get-Content "out\$variant\Changelog.html").Replace('ArchiSteamFarm/commits/master', "ArchiSteamFarm/releases/tag/$env:APPVEYOR_REPO_TAG_NAME") | Set-Content "out\$variant\Changelog.html"
|
|
}
|
|
|
|
# If this build is going to be deployed further, prefer maximum compression
|
|
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2019') {
|
|
$compressionArgs = '-mx=9', '-mfb=258', '-mpass=15'
|
|
}
|
|
}
|
|
|
|
7z a -bd -slp -tzip -mm=Deflate $compressionArgs "out\ASF-$variant.zip" "$env:APPVEYOR_BUILD_FOLDER\out\$variant\*"
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Last command failed."
|
|
}
|
|
|
|
# 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"
|
|
}
|
|
|
|
|
|
foreach ($variant in $env:VARIANTS.Split([char[]] $null, [System.StringSplitOptions]::RemoveEmptyEntries)) {
|
|
Start-Job -Name "$variant" $PublishBlock -ArgumentList "$variant"
|
|
}
|
|
|
|
|
|
Get-Job | Receive-Job -Wait -AutoRemoveJob
|
|
|
|
|
|
if (!($env:APPVEYOR_PULL_REQUEST_NUMBER) -and ($env:APPVEYOR_REPO_BRANCH -eq 'master') -and ($env:APPVEYOR_REPO_TAG -eq 'false') -and (Test-Path 'crowdin.yml' -PathType Leaf) -and (Test-Path 'tools\ArchiCrowdin\crowdin_identity_example.yml' -PathType Leaf) -and (Test-Path 'tools\ArchiCrowdin\archi.ps1' -PathType Leaf)) {
|
|
(Get-Content 'tools\ArchiCrowdin\crowdin_identity_example.yml').Replace('CROWDIN_API_KEY', "$env:CROWDIN_API_KEY").Replace('CROWDIN_PROJECT_IDENTIFIER', "$env:CROWDIN_PROJECT_IDENTIFIER") | Set-Content 'tools\ArchiCrowdin\crowdin_identity.yml'
|
|
|
|
try {
|
|
& tools\ArchiCrowdin\archi.ps1 -u
|
|
} finally {
|
|
Remove-Item 'tools\ArchiCrowdin\crowdin_identity.yml'
|
|
}
|
|
}
|
|
deploy:
|
|
- provider: GitHub
|
|
tag: $(appveyor_repo_tag_name)
|
|
release: ArchiSteamFarm V$(appveyor_repo_tag_name)
|
|
description: '### Notice\n\n**Pre-releases are experimental versions that often contain unpatched bugs, work-in-progress features or rewritten implementations. If you don''t consider yourself advanced user, please download **[latest stable release](https://github.com/JustArchiNET/ArchiSteamFarm/releases/latest)** instead. Pre-release versions are dedicated to users who know how to report bugs, deal with issues and give feedback - no technical support will be given. Check out ASF **[release cycle](https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Release-cycle)** if you''d like to learn more.**\n\n---\n\n### Changelog\n\nThis is automated AppVeyor GitHub deployment, human-readable changelog should be available soon. In the meantime please refer to **[GitHub commits](https://github.com/JustArchiNET/ArchiSteamFarm/commits/$(appveyor_repo_tag_name))**.\n\n---\n\n### Support\n\nASF is available for free, this release was made possible thanks to the people that decided to support the project. If you''re grateful for what we''re doing, please consider donating. Developing ASF requires massive amount of time and knowledge, especially when it comes to Steam (and its problems). Even $1 is highly appreciated and shows that you care. Thank you!\n\n [![GitHub sponsor](https://img.shields.io/badge/GitHub-sponsor-yellow.svg?logo=github)](https://github.com/sponsors/JustArchi) [![Patreon support](https://img.shields.io/badge/Patreon-support-yellow.svg?logo=patreon)](https://www.patreon.com/JustArchi) [![PayPal.me donate](https://img.shields.io/badge/PayPal.me-donate-yellow.svg?logo=paypal)](https://www.paypal.me/JustArchi/5eur) [![PayPal donate](https://img.shields.io/badge/PayPal-donate-yellow.svg?logo=paypal)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HD2P2P3WGS5Y4) [![Bitcoin donate](https://img.shields.io/badge/Bitcoin-donate-yellow.svg?logo=bitcoin)](https://blockstream.info/address/bc1q8archy9jneaqw6s3cs44azt6duyqdt8c6quml0) [![Steam donate](https://img.shields.io/badge/Steam-donate-yellow.svg?logo=steam)](https://steamcommunity.com/tradeoffer/new/?partner=46697991&token=0ix2Ruv_)'
|
|
auth_token:
|
|
secure: uYK1wf3znNdkuQqImXR6rZ94ESgzF1vJHCAcJ75Y+m+/pc/Ro6cikzy6O7DVZ39T
|
|
artifact: /.*/
|
|
draft: false
|
|
prerelease: true
|
|
force_update: false
|
|
on:
|
|
branch: master
|
|
configuration: Release
|
|
appveyor_build_worker_image: Visual Studio 2019
|
|
appveyor_repo_tag: true
|
|
notifications:
|
|
- provider: Webhook
|
|
url:
|
|
secure: i/og7KzkpbcWcKoUubrLH+KB6bkfqA55FHUlGxLepLmgZNQeNMiMoAFICOFY795fFrFfUNUKqwk7ApXE6HUyWMoiijLj7G/JBLTPkBiTCu8fZMTMqwQm6FiHB3+/0h0C+ukcrBEqnXYSQUh6znpKqJSTrIfXUQ7ftNuC966kBAw=
|
|
method: POST
|
|
body: >-
|
|
{
|
|
"avatar_url": "https://www.appveyor.com/assets/img/appveyor-logo-256.png",
|
|
"username": "AppVeyor",
|
|
"content": "[{{projectName}}:{{branch}}] {{commitMessage}} by {{commitAuthor}} ({{commitId}}) | **{{status}}** on {{buildUrl}}"
|
|
}
|
|
on_build_success: true
|
|
on_build_failure: true
|
|
on_build_status_changed: false
|