forked from migueldeicaza/TensorFlowSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
83 lines (68 loc) · 2.05 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
pool:
name: Hosted macOS
demands: msbuild
steps:
- bash: |
echo at:
pwd
echo env:
set
echo dir:
ls
displayName: Environment
- bash: |
if echo $BUILD_SOURCEBRANCH | grep /release/; then
perl -pi -e "s/PackageVersion>.*</PackageVersion>${BUILD_SOURCEBRANCHNAME}</" TensorFlowSharp/TensorFlowSharp.csproj
fi
displayName: 'Update version based on branch name'
- bash: |
TFVERSION=`sed -n 's/.*TensorFlowRuntimeVersion>\(.*\)<.*/\1/p' TensorFlowSharp/TensorFlowSharp.csproj | sed 's/-pre.*//'`
echo TFVERSION is $TFVERSION
mono --version
ROOT=`pwd`
echo Root is: $ROOT
BASE=https://storage.googleapis.com/tensorflow/libtensorflow
WIN=libtensorflow-cpu-windows-x86_64-${TFVERSION}.zip
DARWIN=libtensorflow-cpu-darwin-x86_64-${TFVERSION}.tar.gz
LINUX=libtensorflow-cpu-linux-x86_64-${TFVERSION}.tar.gz
if test x$SKIP_DOWNLOAD = x; then
curl -O $BASE/$WIN
curl -O $BASE/$DARWIN
curl -O $BASE/$LINUX
fi
echo Unzipping Windows
unzip -d PAYLOAD $WIN lib/tensorflow.dll
mv lib/tensorflow.dll PAYLOAD
echo Unzipping Darwin
tar xzvf $DARWIN lib
mv -f lib/libtensorflow* PAYLOAD/
echo Unzipping Linux
tar xzvf $LINUX lib
mv -f lib/* PAYLOAD/
mkdir -p $ROOT/native
mv PAYLOAD/lib/tensorflow.dll PAYLOAD/libtensorflow.dll
rmdir PAYLOAD/lib
cp PAYLOAD/* $ROOT/native
displayName: 'Script - Unpack remote payload'
env:
TFVERSION: 1.9.0
- task: NuGetCommand@2
displayName: 'NuGet restore'
- task: MSBuild@1
displayName: 'MSBuild Restore'
inputs:
msbuildArguments: '/t:restore'
- bash: 'ls -lR'
displayName: 'List contents'
- task: MSBuild@1
displayName: 'Build Solution'
inputs:
msbuildArguments: '/p:Configuration=Release'
restoreNugetPackages: true
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: TensorFlowSharp/bin/Release
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'