Skip to content

Commit

Permalink
Appveyor linux builds (#665)
Browse files Browse the repository at this point in the history
* Fix copy

* Update appveyor.yml

* additional logging on gulp

* Fix permissions on appveyor-package.sh

* Clean debug and nuget cache on windows too
  • Loading branch information
ta264 authored and Qstick committed Mar 12, 2019
1 parent 902f0c1 commit 555ae89
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 42 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -6,14 +6,12 @@ addons:
apt:
packages:
- dos2unix
- nuget
- libchromaprint-tools
update: true
homebrew:
packages:
- yarn
- dos2unix
- nuget
update: true
solution: src/Lidarr.sln
before_install:
Expand Down
8 changes: 5 additions & 3 deletions appveyor-package.sh 100644 → 100755
Expand Up @@ -19,9 +19,11 @@ PublishArtifacts()
7z a -ttar $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar $artifactsFolderLinux/*
7z a -tgzip $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar.gz $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar
rm -f $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.linux.tar

./setup/inno/ISCC.exe "./setup/lidarr.iss"
cp ./setup/output/Lidarr.*windows.exe $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.windows-installer.exe

if [ "${CI_WINDOWS}" = "True" ]; then
./setup/inno/ISCC.exe "./setup/lidarr.iss"
cp ./setup/output/Lidarr.*windows.exe $artifactsFolder/Lidarr.${APPVEYOR_REPO_BRANCH}.${APPVEYOR_BUILD_VERSION}.windows-installer.exe
fi
}

PublishArtifacts
22 changes: 15 additions & 7 deletions appveyor.yml
@@ -1,6 +1,8 @@
version: '0.5.0.{build}'

image: Visual Studio 2017
image:
- Visual Studio 2017
- Ubuntu1804

assembly_info:
patch: true
Expand All @@ -11,28 +13,34 @@ assembly_info:

environment:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
nodejs_version: "8"
nodejs_version: "10"

install:
- git submodule update --init --recursive
- ps: Install-Product node $env:nodejs_version
- cmd: powershell Install-Product node $env:nodejs_version
- sh: nvm install $nodejs_version
- sh: sudo apt update
- sh: sudo apt install -y libchromaprint-tools

build_script:
- C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./build.sh
- cmd: C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./build.sh
- sh: ./build.sh

after_build:
- C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./appveyor-package.sh
- cmd: C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./appveyor-package.sh
- sh: ./appveyor-package.sh
- ps: Get-ChildItem .\_artifacts\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem .\_artifacts\*.exe | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- ps: Get-ChildItem .\_artifacts\*.tar.gz | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

test_script:
- node --version
- yarn --version
- C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./test.sh Windows Unit
- cmd: C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./test.sh Windows Unit
- sh: ./test.sh Linux Unit
- sh: find "$APPVEYOR_BUILD_FOLDER" -type f -name 'myresults.xml' -print0 | xargs -0 -I '{}' curl -F 'file=@{}' "https://ci.appveyor.com/api/testresults/nunit3/$APPVEYOR_JOB_ID"

cache:
- '%USERPROFILE%\.nuget\packages'
- node_modules -> package.json

pull_requests:
Expand Down
5 changes: 4 additions & 1 deletion build.sh
Expand Up @@ -76,7 +76,9 @@ BuildWithMSBuild()
echo $msBuild

export PATH=$msBuild:$PATH
CheckExitCode MSBuild.exe $slnFile //p:Configuration=Debug //p:Platform=x86 //t:Clean //m
CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Clean //m
$nuget locals all -clear
$nuget restore $slnFile
CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Build //m //p:AllowedReferenceRelatedFileExtensions=.pdb
}
Expand All @@ -86,6 +88,7 @@ BuildWithXbuild()
export MONO_IOMAP=case
CheckExitCode msbuild /p:Configuration=Debug /t:Clean $slnFile
CheckExitCode msbuild /p:Configuration=Release /t:Clean $slnFile
mono $nuget locals all -clear
mono $nuget restore $slnFile
CheckExitCode msbuild /p:Configuration=Release /p:Platform=x86 /t:Build /p:AllowedReferenceRelatedFileExtensions=.pdb $slnFile
}
Expand Down Expand Up @@ -259,7 +262,7 @@ PackageTests()
if [ $runtime = "dotnet" ] ; then
$nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
else
nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
mono $nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
fi

cp $outputFolder/*.dll $testPackageFolder
Expand Down
12 changes: 4 additions & 8 deletions frontend/gulp/copy.js
Expand Up @@ -2,24 +2,22 @@ const path = require('path');
const gulp = require('gulp');
const print = require('gulp-print').default;
const cache = require('gulp-cached');
const flatten = require('gulp-flatten');
const livereload = require('gulp-livereload');
const paths = require('./helpers/paths.js');

gulp.task('copyJs', () => {
return gulp.src(
[
path.join(paths.src.root, 'polyfills.js')
])
], { base: paths.src.root })
.pipe(cache('copyJs'))
.pipe(print())
.pipe(flatten())
.pipe(gulp.dest(paths.dest.root))
.pipe(livereload());
});

gulp.task('copyHtml', () => {
return gulp.src(paths.src.html)
return gulp.src(paths.src.html, { base: paths.src.root })
.pipe(cache('copyHtml'))
.pipe(print())
.pipe(gulp.dest(paths.dest.root))
Expand All @@ -28,22 +26,20 @@ gulp.task('copyHtml', () => {

gulp.task('copyFonts', () => {
return gulp.src(
path.join(paths.src.fonts, '**', '*.*')
path.join(paths.src.fonts, '**', '*.*'), { base: paths.src.root }
)
.pipe(cache('copyFonts'))
.pipe(print())
.pipe(flatten({ subPath: 2 }))
.pipe(gulp.dest(paths.dest.root))
.pipe(livereload());
});

gulp.task('copyImages', () => {
return gulp.src(
path.join(paths.src.images, '**', '*.*')
path.join(paths.src.images, '**', '*.*'), { base: paths.src.root }
)
.pipe(cache('copyImages'))
.pipe(print())
.pipe(flatten({ subPath: 2 }))
.pipe(gulp.dest(paths.dest.root))
.pipe(livereload());
});
14 changes: 7 additions & 7 deletions frontend/gulp/helpers/paths.js
@@ -1,15 +1,15 @@
const root = './frontend/src/';
const root = './frontend/src';

const paths = {
src: {
root,
html: `${root}*.html`,
scripts: `${root}**/*.js`,
content: `${root}Content/`,
fonts: `${root}Content/Fonts/`,
images: `${root}Content/Images/`,
html: `${root}/*.html`,
scripts: `${root}/**/*.js`,
content: `${root}/Content/`,
fonts: `${root}/Content/Fonts/`,
images: `${root}/Content/Images/`,
exclude: {
libs: `!${root}JsLibraries/**`
libs: `!${root}/JsLibraries/**`
}
},
dest: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -61,7 +61,6 @@
"gulp": "4.0.0",
"gulp-cached": "1.1.1",
"gulp-concat": "2.6.1",
"gulp-flatten": "0.4.0",
"gulp-livereload": "4.0.1",
"gulp-postcss": "8.0.0",
"gulp-print": "5.0.0",
Expand Down
13 changes: 8 additions & 5 deletions test.sh
Expand Up @@ -20,20 +20,23 @@ if [[ -z "${APPVEYOR}" ]]; then
NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe"
NUNIT_COMMAND="$NUNIT"
NUNIT_PARAMS="--workers=1"
else
elif [ "$PLATFORM" = "Windows" ]; then
NUNIT="nunit3-console"
NUNIT_COMMAND="$NUNIT"
NUNIT_PARAMS="--result=myresults.xml;format=AppVeyor --workers=1"
unset TMP
unset TEMP
else
NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe"
NUNIT_COMMAND="$NUNIT"
NUNIT_PARAMS="--result=myresults.xml --workers=1"
unset TMP
unset TEMP
fi

if [ "$PLATFORM" = "Windows" ]; then
WHERE="$WHERE && cat != LINUX"
elif [ "$PLATFORM" = "Linux" ]; then
WHERE="$WHERE && cat != WINDOWS"
NUNIT_COMMAND="mono --debug --runtime=v4.0 $NUNIT"
elif [ "$PLATFORM" = "Mac" ]; then
elif [ "$PLATFORM" = "Linux" ] || [ "$PLATFORM" = "Mac" ] ; then
WHERE="$WHERE && cat != WINDOWS"
NUNIT_COMMAND="mono --debug --runtime=v4.0 $NUNIT"
else
Expand Down
Binary file modified tools/nuget/nuget.exe
Binary file not shown.
8 changes: 0 additions & 8 deletions yarn.lock
Expand Up @@ -3911,14 +3911,6 @@ gulp-concat@2.6.1:
through2 "^2.0.0"
vinyl "^2.0.0"

gulp-flatten@0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/gulp-flatten/-/gulp-flatten-0.4.0.tgz#d9ac819416c30fd5dfb3dea9da79c83a1bcd61d1"
integrity sha512-eg4spVTAiv1xXmugyaCxWne1oPtNG0UHEtABx5W8ScLiqAYceyYm6GYA36x0Qh8KOIXmAZV97L2aYGnKREG3Sg==
dependencies:
plugin-error "^0.1.2"
through2 "^2.0.0"

gulp-livereload@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/gulp-livereload/-/gulp-livereload-4.0.1.tgz#cb438e62f24363e26b44ddf36fd37c274b8b15ee"
Expand Down

0 comments on commit 555ae89

Please sign in to comment.