-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
name: 🔍 Pull Request Check | ||
name: 🌙 Nightly Build | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
validateAndroid: | ||
name: 🤖 Validate Android Build | ||
buildAndroid: | ||
permissions: write-all | ||
name: 🤖📦 Build Android APK | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repository | ||
|
@@ -23,16 +21,42 @@ jobs: | |
java-version: "21.x" | ||
cache: "gradle" | ||
distribution: "adopt" | ||
id: java | ||
|
||
- name: 🔍 Run tests | ||
run: ./gradlew test | ||
- name: 🔐 Retrieve base64 keystore and decode it to a file | ||
id: write_file | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: "android-keystore.jks" | ||
fileDir: "${{ github.workspace }}/" | ||
encodedString: ${{ secrets.KEYSTORE_FILE_BASE64 }} | ||
|
||
- name: 📝🔐 Create keystore.properties file | ||
env: | ||
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/key.properties | ||
run: | | ||
echo "storeFile=${{ github.workspace }}/android-keystore.jks" > $KEYSTORE_PROPERTIES_PATH | ||
echo "keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}" >> $KEYSTORE_PROPERTIES_PATH | ||
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH | ||
echo "keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH | ||
- name: 🏗️ Verify debug build | ||
run: ./gradlew assembleDebug | ||
- name: 🤖📦 Create Android release | ||
run: | | ||
./gradlew app:assembleRelease | ||
- name: 📦 Upload debug APK | ||
- name: 📝 Generate build date | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- name: 📝 Generate SHA-256 | ||
run: | | ||
cd app/build/outputs/apk/release/ | ||
sha256sum *.apk > SHA256SUMS.txt | ||
- name: "Echo SHA-256 sums" | ||
run: cat app/build/outputs/apk/release/SHA256SUMS.txt | ||
- name: 📦 Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: app-debug | ||
path: app/build/outputs/apk/debug/*.apk | ||
name: app-release | ||
# Include both the APK and the SHA-256 sums | ||
path: app/build/outputs/apk/release/ | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 🔍 Pull Request Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
validateAndroid: | ||
name: 🤖 Validate Android Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⚙️ Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "21.x" | ||
cache: "gradle" | ||
distribution: "adopt" | ||
|
||
- name: 🔍 Run tests | ||
run: ./gradlew test | ||
|
||
- name: 🏗️ Verify debug build | ||
run: ./gradlew assembleDebug | ||
|
||
- name: 📦 Upload debug APK | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: app-debug | ||
path: app/build/outputs/apk/debug/*.apk | ||
retention-days: 7 |