forked from florisboard/florisboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
97 lines (78 loc) · 2.98 KB
/
azure-pipelines.yml
File metadata and controls
97 lines (78 loc) · 2.98 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
trigger: none
pool:
vmImage: 'ubuntu-latest'
variables:
- group: TrackmanKeyboard
steps:
- checkout: self
submodules: true
- task: JavaToolInstaller@0
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
displayName: 'Set up JDK 17'
- script: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
displayName: 'Set up CMake and Ninja'
- script: |
LATEST_BUILD_TOOLS=$(ls -1 $ANDROID_HOME/build-tools | sort -n | tail -1)
echo "##vso[task.setvariable variable=LATEST_BUILD_TOOLS]$LATEST_BUILD_TOOLS"
echo "Found build-tools: $LATEST_BUILD_TOOLS"
displayName: 'Detect latest Android Build Tools'
- task: DownloadSecureFile@1
name: downloadSigningCert
inputs:
secureFile: $(keystoreFileName)
displayName: 'Download Standard Signing Certificate'
- task: DownloadSecureFile@1
name: platformKeyFile
inputs:
secureFile: msinda2_platform.pk8
displayName: 'Download MSI Platform Key'
- task: DownloadSecureFile@1
name: platformCertFile
inputs:
secureFile: msinda2_platform.x509.pem
displayName: 'Download MSI Platform Certificate'
- script: |
cp keystore.properties keystore.properties.bak
cat <<EOF > keystore.properties
storeFile=$(downloadSigningCert.secureFilePath)
storePassword=$(keystorePassword)
keyAlias=$(keystoreAlias)
keyPassword=$(keystorePassword)
EOF
displayName: 'Configure Release keystore.properties'
- script: ./gradlew clean assembleStandardRelease assembleMsiRelease
displayName: 'Build Release APKs (Standard & MSI)'
- script: mv app/build/outputs/apk/standard/release/app-standard-release.apk dk.trackman.keyboard.apk
displayName: 'Rename Standard Signed APK'
# Create MSI Variant: Re-sign the APK with Platform Keys
- script: |
echo "Locating apksigner..."
APKSIGNER="$ANDROID_HOME/build-tools/$(LATEST_BUILD_TOOLS)/apksigner"
echo "Signing MSI APK with Platform Keys..."
"$APKSIGNER" sign \
--key $(platformKeyFile.secureFilePath) \
--cert $(platformCertFile.secureFilePath) \
--out dk.trackman.keyboard.msinda2.apk \
app/build/outputs/apk/msi/release/app-msi-release.apk
echo "Verifying MSI Signature..."
"$APKSIGNER" verify --verbose dk.trackman.keyboard.msinda2.apk
displayName: 'Sign MSI APK with Platform Keys'
- script: mv keystore.properties.bak keystore.properties
displayName: 'Restore original keystore.properties'
- script: |
./gradlew --stop
displayName: 'Gradlew stop'
- script: |
cp dk.trackman.keyboard.apk $(Build.ArtifactStagingDirectory)
cp dk.trackman.keyboard.msinda2.apk $(Build.ArtifactStagingDirectory)
displayName: 'Copy APKs to Artifact folder'
- task: PublishBuildArtifacts@1
displayName: 'Publish APK Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'trackman-keyboard-release'