mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
99 lines
3.5 KiB
YAML
99 lines
3.5 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
|
|
|
|
# ASF is based on .NET Core platform, we're not building with Mono
|
|
dotnet: 3.1
|
|
mono: none
|
|
|
|
env:
|
|
global:
|
|
- CONFIGURATION: Release
|
|
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
|
- NET_CORE_VERSION: netcoreapp3.1
|
|
- 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:
|
|
packages: p7zip
|
|
before_script:
|
|
- |
|
|
set -eu
|
|
|
|
dotnet --info
|
|
set +u # This is needed to continue Travis build
|
|
script:
|
|
- |
|
|
set -eu
|
|
|
|
nvm install lts/*
|
|
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 clean ArchiSteamFarm -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -p:UseAppHost=false --nologo
|
|
dotnet restore ArchiSteamFarm
|
|
|
|
publish() {
|
|
if [ "$1" = 'generic' ]; then
|
|
local variantArgs="-p:UseAppHost=false"
|
|
else
|
|
local variantArgs="-p:PublishSingleFile=true -p:PublishTrimmed=true -r $1"
|
|
fi
|
|
|
|
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 [ -d "ArchiSteamFarm/overlay/${1}" ]; then
|
|
cp "ArchiSteamFarm/overlay/${1}/"* "out/${1}"
|
|
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"
|
|
|
|
if command -v 7z >/dev/null; then
|
|
7z a -bd -slp -tzip -mm=Deflate -mx=1 "out/ASF-${1}.zip" "${TRAVIS_BUILD_DIR}/out/${1}/*"
|
|
elif command -v zip >/dev/null; then
|
|
(
|
|
cd "${TRAVIS_BUILD_DIR}/out/${1}"
|
|
zip -1 -q -r "../ASF-${1}.zip" .
|
|
)
|
|
else
|
|
echo "ERROR: No supported zip tool!"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
jobs=""
|
|
|
|
for variant in $VARIANTS; do
|
|
publish "$variant" &
|
|
jobs="$jobs $!"
|
|
done
|
|
|
|
for job in $jobs; do
|
|
wait "$job"
|
|
done
|
|
|
|
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/linux
|
|
dist: bionic
|
|
- os: osx
|
|
# Ref: https://docs.travis-ci.com/user/reference/osx
|
|
dotnet: 3.1.300 # For OSX, we need absolute dotnet version until https://github.com/dotnet/core-setup/issues/4187 is resolved
|
|
osx_image: xcode11.4
|