forked from KomodoPlatform/komodo-defi-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-android-job.yml
64 lines (63 loc) · 2.78 KB
/
azure-pipelines-android-job.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
parameters:
os: ''
jobs:
- job: MM2_Android
timeoutInMinutes: 0 # 0 means infinite for self-hosted agent
pool:
name: Default
demands: agent.os -equals ${{ parameters.os }}
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: ${{ eq( variables['Build.Reason'], 'Schedule' ) }} # clean up only on Scheduled build
- bash: |
if [ $CLEANUP = "true" ]
then
git clean -ffdx
fi
displayName: Clean Up
failOnStderr: false
continueOnError: true
- bash: |
export TAG="$(git rev-parse --short=9 HEAD)"
echo "##vso[task.setvariable variable=COMMIT_HASH]${TAG}"
displayName: Setup ENV
- bash: |
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_android_armv7_CI
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
cat MM_VERSION
export PATH=$PATH:/home/azureagent/android-ndk/arch-ndk/x86_64/android-ndk/bin
CC_armv7_linux_androideabi=armv7a-linux-androideabi21-clang CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang cargo rustc --target=armv7-linux-androideabi --lib --profile ci --crate-type=staticlib --package mm2_bin_lib
displayName: 'Build armv7'
env:
MANUAL_MM_VERSION: true
- bash: |
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_android_aarch64_CI
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
cat MM_VERSION
export PATH=$PATH:/home/azureagent/android-ndk/arch-ndk/x86_64/android-ndk/bin
CC_aarch64_linux_android=aarch64-linux-android21-clang CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang cargo rustc --target=aarch64-linux-android --lib --profile ci --crate-type=staticlib --package mm2_bin_lib
displayName: 'Build aarch64'
env:
MANUAL_MM_VERSION: true
- bash: |
rm -rf upload
mkdir upload
mv target/armv7-linux-androideabi/ci/libmm2lib.a upload/libmm2.a
zip upload/mm2-$(COMMIT_HASH)-android-armv7-CI upload/libmm2.a -j
rm upload/libmm2.a
mv target/aarch64-linux-android/ci/libmm2lib.a upload/libmm2.a
zip upload/mm2-$(COMMIT_HASH)-android-aarch64-CI upload/libmm2.a -j
rm upload/libmm2.a
displayName: 'Prepare upload'
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: nightly_build_server
sourceFolder: 'upload' # Optional
contents: "**"
targetFolder: "uploads/$(Build.SourceBranchName)" # Optional
overwrite: true
displayName: 'Upload nightly'