Skip to content

Commit 9a958c2

Browse files
committed
Add CI workflow for Shrine sample
1 parent 0631d23 commit 9a958c2

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/build-shrine.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Workflow name
2+
name: Build Shrine Sample
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set Up JDK
18+
uses: actions/setup-java@v3
19+
with:
20+
distribution: 'zulu'
21+
java-version: '17'
22+
cache: 'gradle'
23+
24+
- name: Setup Gradle
25+
uses: gradle/actions/setup-gradle@v4
26+
27+
- name: Install Android SDK Platform VanillaIceCream
28+
run: |
29+
echo "y" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null
30+
echo "y" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "platforms;android-35"
31+
32+
# The sample includes a keystore.properties.template.
33+
# For a CI build, we might need to provide a dummy or generated keystore.
34+
# For now, let's assume the build works without a specific signing config for debug.
35+
# If it requires specific signing for debug, this might fail or need adjustment.
36+
- name: Create dummy keystore.properties if not exists
37+
run: |
38+
if [ ! -f Shrine/keystore.properties ]; then
39+
echo "Creating dummy keystore.properties for CI build"
40+
echo "storeFile=debug.keystore" > Shrine/keystore.properties
41+
echo "storePassword=android" >> Shrine/keystore.properties
42+
echo "keyAlias=androiddebugkey" >> Shrine/keystore.properties
43+
echo "keyPassword=android" >> Shrine/keystore.properties
44+
fi
45+
# Ensure a debug.keystore exists if not provided by checkout
46+
if [ ! -f Shrine/debug.keystore ]; then
47+
echo "Generating dummy debug.keystore for CI build"
48+
keytool -genkey -v -keystore Shrine/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
49+
fi
50+
working-directory: . # Run from checkout root so Shrine/ path is correct
51+
52+
- name: Make gradlew executable
53+
run: chmod +x ./gradlew
54+
working-directory: ./Shrine
55+
56+
- name: Build Shrine app
57+
working-directory: ./Shrine
58+
run: ./gradlew app:assembleDebug

0 commit comments

Comments
 (0)