Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
IamRezaMousavi committed Jun 24, 2024
1 parent 9695de4 commit 9ec40b3
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: set up JDK
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -36,3 +37,4 @@ jobs:

- name: Build Debug
run: ./gradlew assembleDebug

39 changes: 39 additions & 0 deletions .github/workflows/gradle-wrapper-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Gradle wrapper update

on:
workflow_dispatch: # to run the workflow manually if needed
schedule:
- cron: '0 12 * * *'

jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: gradle

- name: Upgrade gradle wrapper
run: |
./gradlew wrapper --gradle-version latest
./gradlew wrapper --gradle-version latest
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: 'Upgrade Gradle version'
body: ''
delete-branch: false
branch: 'upgrade-gradle-version'
commit-message: 'upgrade gradle version'

17 changes: 11 additions & 6 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@ jobs:

- name: Get apk file path
id: apkFile
run: echo "apkfile=$(find app/build/outputs/apk/nightly/*.apk)" >> $GITHUB_OUTPUT
run: |
mv $(find app/build/outputs/apk/nightly/*.apk) banafsh_$(date "+%Y-%m-%d")_nightly.apk
echo "apkfile=$(find banafsh_*_nightly.apk)" >> $GITHUB_OUTPUT
- name: Send apk to telegram
run: |
curl https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \
-F chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \
-F "caption=Size: $(ls -l --block-size=K "${{ steps.apkFile.outputs.apkfile }}" | awk '{ print $5 }')" \
-F parse_mode=HTML \
-F document=@"${{ steps.apkFile.outputs.apkfile }}"
- name: Upload Nightly Build to Artifacts
uses: actions/upload-artifact@v4
with:
name: banafsh-nightly.apk
path: ${{ steps.apkFile.outputs.apkfile }}
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ android {
matchingFallbacks += "release"

applicationIdSuffix = ".nightly"
versionNameSuffix = "-NIGHTLY"
versionNameSuffix = "-${defaultConfig.versionName}-NIGHTLY"
manifestPlaceholders["appName"] = "Banafsh Nightly"
signingConfig = signingConfigs.findByName("ci")
}
Expand Down

0 comments on commit 9ec40b3

Please sign in to comment.