1+ name : Build and Release Alpha APK
2+
3+ on :
4+ push :
5+ tags :
6+ - " alpha-*"
7+ workflow_dispatch :
8+
9+ jobs :
10+ build :
11+ name : Build and Sign APK
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout Repository
16+ uses : actions/checkout@v6
17+ with :
18+ submodules : recursive
19+ fetch-depth : 0
20+
21+ - name : Set up JDK
22+ uses : actions/setup-java@v5
23+ with :
24+ distribution : temurin
25+ java-version : " 17"
26+
27+ - name : Set up Android SDK
28+ uses : android-actions/setup-android@v4
29+
30+ - name : Decode Keystore
31+ env :
32+ KEYSTORE_BASE64 : ${{ secrets.KEYSTORE_BASE64 }}
33+ run : |
34+ echo "$KEYSTORE_BASE64" | base64 --decode > keystore.jks
35+
36+ - name : Set Environment Variables
37+ run : |
38+ echo "KEYSTORE_PATH=$PWD/keystore.jks" >> $GITHUB_ENV
39+ echo "KEYSTORE_PASSWORD=$(echo -n '${{ secrets.KEYSTORE_PASSWORD }}')" >> $GITHUB_ENV
40+ echo "KEY_ALIAS=$(echo -n '${{ secrets.KEY_ALIAS }}')" >> $GITHUB_ENV
41+ echo "KEY_PASSWORD=$(echo -n '${{ secrets.KEY_PASSWORD }}')" >> $GITHUB_ENV
42+
43+ - name : Grant Execute Permission to Gradle
44+ run : chmod +x gradlew
45+
46+ - name : Build APKs
47+ run : ./gradlew assembleGithubRelease --stacktrace
48+
49+ - name : Upload APKs as Artifacts
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : Signed-APKs
53+ path : app/build/outputs/apk/github/release/*.apk
54+
55+ release :
56+ name : Create GitHub Pre-release
57+ needs : build
58+ if : startsWith(github.ref, 'refs/tags/alpha-')
59+ runs-on : ubuntu-latest
60+
61+ steps :
62+ - name : Checkout Repository
63+ uses : actions/checkout@v6
64+
65+ - name : Download Signed APKs
66+ uses : actions/download-artifact@v8
67+ with :
68+ name : Signed-APKs
69+ path : artifacts/
70+
71+ - name : Publish GitHub Pre-release
72+ env :
73+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ run : |
75+ APK_FILES=$(find artifacts -name "*.apk")
76+
77+ if [ -z "$APK_FILES" ]; then
78+ echo "❌ No APKs found!"
79+ exit 1
80+ fi
81+
82+ echo "✅ Found APKs:"
83+ echo "$APK_FILES"
84+
85+ gh release create "${{ github.ref_name }}" \
86+ $APK_FILES \
87+ --title "aShell You ${{ github.ref_name }}" \
88+ --notes "⚠️ Experimental alpha build. May contain bugs." \
89+ --prerelease
0 commit comments