-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (129 loc) · 4.87 KB
/
Copy pathandroid.yml
File metadata and controls
148 lines (129 loc) · 4.87 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Android CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: android-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
jobs:
build:
name: Test and build APK
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Check out source
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Set up Android SDK
uses: android-actions/setup-android@v4
- name: Install pinned Android toolchain
shell: bash
run: |
sdkmanager \
"platforms;android-36" \
"build-tools;36.0.0" \
"ndk;28.2.13676358"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build and self-test XI2 Touchscope probe
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
desktop-file-utils \
libx11-dev \
libxi-dev
make -C tools/touchscope
tools/touchscope/touchscope --self-test
desktop-file-validate tools/touchscope/touchscope.desktop
make -C tools/touchscope clean
- name: Prepare stable update signing
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
env:
SIGNING_STORE_BASE64: ${{ secrets.UDROID_SIGNING_STORE_BASE64 }}
SIGNING_STORE_PASSWORD: ${{ secrets.UDROID_SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.UDROID_SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.UDROID_SIGNING_KEY_PASSWORD }}
run: |
: "${SIGNING_STORE_BASE64:?UDROID_SIGNING_STORE_BASE64 is required}"
: "${SIGNING_STORE_PASSWORD:?UDROID_SIGNING_STORE_PASSWORD is required}"
: "${SIGNING_KEY_ALIAS:?UDROID_SIGNING_KEY_ALIAS is required}"
: "${SIGNING_KEY_PASSWORD:?UDROID_SIGNING_KEY_PASSWORD is required}"
printf '%s' "${SIGNING_STORE_BASE64}" \
| base64 --decode > "${RUNNER_TEMP}/udroid-updates.p12"
echo "UDROID_SIGNING_STORE_FILE=${RUNNER_TEMP}/udroid-updates.p12" >> "${GITHUB_ENV}"
echo "UDROID_SIGNING_STORE_PASSWORD=${SIGNING_STORE_PASSWORD}" >> "${GITHUB_ENV}"
echo "UDROID_SIGNING_KEY_ALIAS=${SIGNING_KEY_ALIAS}" >> "${GITHUB_ENV}"
echo "UDROID_SIGNING_KEY_PASSWORD=${SIGNING_KEY_PASSWORD}" >> "${GITHUB_ENV}"
- name: Verify release tag matches Android version
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
VERSION_NAME="$(
sed -n 's/^[[:space:]]*versionName = "\(.*\)"/\1/p' app/build.gradle.kts
)"
test -n "${VERSION_NAME}"
test "v${VERSION_NAME}" = "${GITHUB_REF_NAME}"
- name: Test, lint, and assemble optimized APK
run: ./gradlew --no-daemon testDebugUnitTest lintDebug assembleRelease
- name: Verify embedded X11 release JNI contract
run: tools/verify-release-jni-contract.sh app/build/outputs/apk/release/app-release.apk
- name: Package release assets
shell: bash
run: |
mkdir -p release-assets
cp app/build/outputs/apk/release/app-release.apk \
"release-assets/udroid-${GITHUB_REF_NAME}-prerelease.apk"
(
cd release-assets
sha256sum "udroid-${GITHUB_REF_NAME}-prerelease.apk" > SHA256SUMS
)
- name: Upload APK artifact
uses: actions/upload-artifact@v7
with:
name: udroid-${{ github.ref_name }}-prerelease
path: release-assets/*
if-no-files-found: error
retention-days: 30
release:
name: Publish GitHub prerelease
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Download verified build assets
uses: actions/download-artifact@v8
with:
name: udroid-${{ github.ref_name }}-prerelease
path: release-assets
- name: Publish tagged prerelease
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
release-assets/* \
--repo "${GITHUB_REPOSITORY}" \
--verify-tag \
--prerelease \
--title "uDroid ${GITHUB_REF_NAME}" \
--notes "Extremely early development build for testing and contributor feedback. Expect breaking changes and incomplete features. This universal optimized APK uses the project update-signing key and is not a production release."