-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
a8837e8
commit b838386
Showing
10 changed files
with
9,182 additions
and
6,801 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,60 +1,79 @@ | ||
name: Android CI/CD Pipeline 🚀 | ||
name: Android CI | ||
|
||
env: | ||
# The name of the main module repository | ||
main_project_module: app | ||
|
||
on: | ||
push: | ||
branches: [ 'master' ] | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ 'master' ] | ||
workflow_dispatch: # Allows manual trigger | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 🛎️ Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: ☕ Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
- uses: actions/checkout@v3 | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
distribution: 'corretto' | ||
cache: gradle | ||
|
||
- name: 🗂️ Cache Gradle dependencies | ||
uses: actions/cache@v3 | ||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradlew*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: 🔑 Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
|
||
- name: 🏗️ Build with Gradle | ||
run: ./gradlew assembleRelease --scan --no-daemon | ||
|
||
# - name: 🧪 Run Unit Tests | ||
# run: ./gradlew test | ||
# | ||
# - name: 📤 Upload Test Reports | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: test-report | ||
# path: build/reports/tests/test | ||
|
||
- name: 🎨 Check Code Style with KtLint | ||
run: ./gradlew ktlintCheck | ||
|
||
- name: 📤 Upload KtLint Reports | ||
uses: actions/upload-artifact@v4 | ||
gradle-version: 7.5 | ||
- name: Create base64 jks file | ||
run: echo "${{ secrets.BASE_64_SIGNING_KEY }}" > release_keystore.txt | ||
- name: Create jks file | ||
run: base64 -d "release_keystore.txt" > app/release_keystore.jks | ||
- name: Create Blank Local Properties FIle | ||
run: touch local.properties | ||
- name: Create Keystore Properties File | ||
run: echo "${{ secrets.LOCAL_PROPERTIES }}" > keystore.properties | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build --warning-mode all | ||
- name: Set current date as env variable | ||
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
# Create APK Debug | ||
- name: Build apk debug project (APK) | ||
run: ./gradlew assembleDebug | ||
# Create APK Release | ||
- name: Build apk release project (APK) | ||
run: ./gradlew assemble | ||
# Upload Artifact Build | ||
# Noted For Output [main_project_module]/build/outputs/apk/debug/ | ||
- name: Upload APK Debug | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: GameVault APK debug generated | ||
path: ${{ env.main_project_module }}/build/outputs/apk/debug/ | ||
|
||
# Noted For Output [main_project_module]/build/outputs/apk/release/ | ||
- name: Upload APK Release | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ktlint-report | ||
path: build/reports/ktlint/ | ||
name: GameVault APK release generated | ||
path: ${{ env.main_project_module }}/build/outputs/apk/release/ | ||
|
||
- name: 📲 Upload APK | ||
uses: actions/upload-artifact@v4 | ||
- name: send telegram message on push or pull | ||
uses: appleboy/telegram-action@master | ||
with: | ||
name: release-apk | ||
path: app/build/outputs/apk/release/*.apk | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
message: | | ||
👤 ${{ github.actor }} pushed to branch `${{ github.ref_name }}`. | ||
📄 Commit message: ${{ github.event.commits[0].message }} | ||
📂 Repository: ${{ github.repository }} | ||
🔗 See commit: https://github.com/${{ github.repository }}/commit/${{github.sha}} | ||
$(if github.event.pull_request) | ||
🔗 Pull Request: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} | ||
$(endif) |
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,31 @@ | ||
name: Telegram Builder | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: send telegram message on push | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: markdown | ||
photo: https://raw.githubusercontent.com/MostafaMohamed2002/GameVault/refs/heads/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp | ||
disable_web_page_preview: false | ||
message: | | ||
GameVault has a new release: [${{ github.event.release.tag_name }}](https://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}) | ||
```markdown | ||
${{ github.event.release.body }} | ||
``` | ||
[${{ github.event.release.assets[0].name }}](${{ github.event.release.assets[0].browser_download_url }}) | ||
[${{ github.event.release.assets[1].name }}](${{ github.event.release.assets[1].browser_download_url }}) | ||
[${{ github.event.release.assets[2].name }}](${{ github.event.release.assets[2].browser_download_url }}) | ||
[${{ github.event.release.assets[3].name }}](${{ github.event.release.assets[3].browser_download_url }}) | ||
[${{ github.event.release.assets[4].name }}](${{ github.event.release.assets[4].browser_download_url }}) | ||
[${{ github.event.release.assets[5].name }}](${{ github.event.release.assets[5].browser_download_url }}) |
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 |
---|---|---|
|
@@ -15,3 +15,5 @@ | |
.cxx | ||
local.properties | ||
.log | ||
|
||
.kotlin/sessions/ |
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
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
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
Oops, something went wrong.