ArchiSteamFarm/appveyor.yml

268 lines
9.8 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:
CROWDIN_API_KEY:
secure: oGuZaQo2z5/JkEYaKrD9Ing+TgwZ3qQVf+9Jdz73Fephy04z5rWPGCCtkjaMLTcY
CROWDIN_PROJECT_IDENTIFIER: archisteamfarm
DOTNET_CHANNEL: 3.1
2017-06-30 01:54:48 +00:00
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_INSTALL_DIR: C:\Program Files\dotnet
2017-06-30 01:54:48 +00:00
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
NET_CORE_VERSION: netcoreapp3.1
2019-08-01 21:31:07 +00:00
NET_FRAMEWORK_VERSION: net48
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
&([scriptblock]::Create((Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1'))) -Channel "$env:DOTNET_CHANNEL" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath
}
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."
}
java -version
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."
}
dotnet build ArchiSteamFarm -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" --nologo
2018-05-19 19:48:26 +00:00
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" --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
dotnet test ArchiSteamFarm.Tests -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" --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
$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*') {
2020-04-22 20:27:59 +00:00
$variantArgs = '-p:UseAppHost=false'
} else {
2020-04-22 20:27:59 +00:00
$variantArgs = '-p:PublishTrimmed=true', '-r', "$variant"
}
2017-06-30 05:54:18 +00:00
2020-04-22 20:27:59 +00:00
dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -f "$targetFramework" -o "out\$variant" "-p:ASFVariant=$variant" --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
}
2019-01-12 01:00:19 +00:00
# If we include any overlay for this variant, copy it output directory
if (Test-Path "ArchiSteamFarm\overlay\$variant" -PathType Container) {
Copy-Item "ArchiSteamFarm\overlay\$variant\*" "out\$variant"
2017-09-23 02:43:27 +00:00
}
# Until https://github.com/dotnet/cli/issues/3267 happens, we'll hack dotnet binary icon on Windows and include .ico file on other platforms
2018-09-14 03:35:08 +00:00
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"
2018-05-19 19:48:26 +00:00
}
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) {
(Get-Content "out\$variant\Changelog.html").Replace('ArchiSteamFarm/commits/master', "ArchiSteamFarm/releases/tag/$env:APPVEYOR_REPO_TAG_NAME") | Set-Content "out\$variant\Changelog.html"
2017-09-28 03:07:23 +00:00
}
# If this build is going to be deployed further, prefer maximum compression
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2019') {
2020-04-10 17:33:31 +00:00
$compressionArgs = '-mx=9', '-mfb=258', '-mpass=15'
}
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
}
dotnet clean ArchiSteamFarm -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" --nologo
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
dotnet restore ArchiSteamFarm
if ($LastExitCode -ne 0) {
throw "Last command failed."
}
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'
}
}
2017-06-30 01:54:48 +00:00
deploy:
- provider: GitHub
tag: $(appveyor_repo_tag_name)
2017-07-05 06:00:30 +00:00
release: ArchiSteamFarm V$(appveyor_repo_tag_name)
2019-10-22 17:59:29 +00:00
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)](https://github.com/sponsors/JustArchi) [![Patreon support](https://img.shields.io/badge/Patreon-support-yellow.svg)](https://www.patreon.com/JustArchi) [![Paypal.me donate](https://img.shields.io/badge/Paypal.me-donate-yellow.svg)](https://www.paypal.me/JustArchi/5eur) [![Paypal donate](https://img.shields.io/badge/Paypal-donate-yellow.svg)](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)](https://blockstream.info/address/bc1q8archy9jneaqw6s3cs44azt6duyqdt8c6quml0) [![Steam donate](https://img.shields.io/badge/Steam-donate-yellow.svg)](https://steamcommunity.com/tradeoffer/new/?partner=46697991&token=0ix2Ruv_)'
2017-06-30 01:54:48 +00:00
auth_token:
2018-09-23 01:31:47 +00:00
secure: uYK1wf3znNdkuQqImXR6rZ94ESgzF1vJHCAcJ75Y+m+/pc/Ro6cikzy6O7DVZ39T
2017-06-30 01:54:48 +00:00
artifact: /.*/
2017-07-05 03:49:23 +00:00
draft: false
2017-06-30 01:54:48 +00:00
prerelease: true
force_update: false
on:
branch: master
configuration: Release
appveyor_build_worker_image: Visual Studio 2019
2017-07-15 02:45:44 +00:00
appveyor_repo_tag: true
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