mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
88 lines
3.1 KiB
YAML
88 lines
3.1 KiB
YAML
# ASF is a C# project with a solution file named ArchiSteamFarm.sln
|
|
language: csharp
|
|
solution: ArchiSteamFarm.sln
|
|
|
|
# We can save bandwidth by limiting git clone to only last 10 commits
|
|
git:
|
|
depth: 10
|
|
|
|
# Use latest images for building: https://blog.travis-ci.com/2017-12-01-new-update-schedule-for-linux-build-images
|
|
group: travis_latest
|
|
|
|
# ASF is based on .NET Core platform, we're not building with Mono
|
|
dotnet: 2.2
|
|
mono: none
|
|
|
|
env:
|
|
global:
|
|
- CONFIGURATION: Release
|
|
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
|
- NET_CORE_VERSION: netcoreapp2.2
|
|
- VARIANTS="generic linux-arm linux-x64 osx-x64 win-x64" # NOTE: When modifying variants, don't forget to update ASF_VARIANT definitions in SharedInfo.cs!
|
|
before_script:
|
|
- |
|
|
set -eu
|
|
|
|
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
|
ulimit -n 1024
|
|
fi
|
|
|
|
dotnet --info
|
|
set +u # This is needed to continue Travis build
|
|
script:
|
|
- |
|
|
set -eu
|
|
|
|
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
|
set +eu # This is needed to run below npm block on OSX
|
|
fi
|
|
|
|
cd ASF-ui
|
|
npm ci
|
|
npm run-script deploy
|
|
cd ..
|
|
|
|
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
|
set -eu # We no longer need +eu on OSX
|
|
fi
|
|
|
|
dotnet build ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o 'out/source' /nologo
|
|
dotnet build ArchiSteamFarm.CustomPlugins.ExamplePlugin -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o 'out/source' /nologo
|
|
dotnet test ArchiSteamFarm.Tests -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o 'out/source' /nologo
|
|
|
|
publish() {
|
|
if [ "$1" = 'generic' ]; then
|
|
# TODO: Workaround https://github.com/mono/linker/issues/286 (don't forget to remove it from docker files too)
|
|
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${1}" --no-restore /nologo "/p:ASFVariant=$1" "/p:LinkDuringPublish=false"
|
|
else
|
|
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${1}" -r "$1" --no-restore /nologo "/p:ASFVariant=$1"
|
|
fi
|
|
|
|
# If we include any overlay for this variant, copy it to output directory
|
|
if [ -d "ArchiSteamFarm/overlay/${1}" ]; then
|
|
cp "ArchiSteamFarm/overlay/${1}/"* "ArchiSteamFarm/out/${1}"
|
|
fi
|
|
}
|
|
|
|
dotnet restore ArchiSteamFarm
|
|
|
|
for variant in $VARIANTS; do
|
|
publish "$variant" &
|
|
done
|
|
|
|
wait
|
|
set +u # This is needed to continue Travis build
|
|
matrix:
|
|
# We can use fast finish, as we don't need to wait for allow_failures builds to mark build as success
|
|
fast_finish: true
|
|
include:
|
|
# We're building ASF with dotnet on latest versions of Linux and OS X
|
|
# Sadly, travis is still missing support for selecting latest images: https://github.com/travis-ci/travis-ci/issues/8922
|
|
- os: linux
|
|
# Ref: https://docs.travis-ci.com/user/reference/xenial
|
|
dist: xenial
|
|
- os: osx
|
|
# Ref: https://docs.travis-ci.com/user/reference/osx
|
|
dotnet: 2.2.103 # For OSX, we need absolute dotnet version until https://github.com/dotnet/core-setup/issues/4187 is resolved
|
|
osx_image: xcode10.1
|