File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build & Push Selaura Launcher
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+ workflow_dispatch :
9+
10+ env :
11+ CDN_REPO : https://x-access-token:${{ secrets.CDN_TOKEN }}@github.com/selauraclient/cdn.git
12+ COMMIT_EMAIL : " github-actions@users.noreply.github.com"
13+ COMMIT_NAME : " GitHub Actions"
14+
15+ jobs :
16+ build-launcher :
17+ runs-on : ubuntu-latest
18+
19+ steps :
20+ - name : Checkout Launcher Repo
21+ uses : actions/checkout@v3
22+
23+ - name : Set up JDK
24+ uses : actions/setup-java@v3
25+ with :
26+ distribution : ' temurin'
27+ java-version : ' 17'
28+
29+ - name : Grant Execute Permission for Gradle
30+ run : chmod +x ./gradlew
31+
32+ - name : Build APK
33+ run : ./gradlew assembleRelease
34+
35+ - name : Upload APK to CDN Repo
36+ run : |
37+ git config --global user.email "$COMMIT_EMAIL"
38+ git config --global user.name "$COMMIT_NAME"
39+ git clone $CDN_REPO cdn
40+ mkdir -p cdn/launcher
41+
42+ APK_PATH=$(find . -type f -name "*release*.apk" | head -n 1)
43+ if [ -z "$APK_PATH" ]; then
44+ echo "❌ No APK found!" && exit 1
45+ fi
46+
47+ cp "$APK_PATH" cdn/launcher/
48+ cd cdn
49+ git add .
50+ git commit -m "Upload Launcher APK from ${{ github.sha }}" || echo "No changes to commit"
51+ git push
You can’t perform that action at this time.
0 commit comments