Android nightly build #410
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
name: Android nightly build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * *' # run at 2 AM UTC | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
ref: 'master' | |
- name: Replace applicationId and name | |
run: | | |
sed -i 's/applicationId "xyz.zedler.patrick.grocy"/applicationId "xyz.zedler.patrick.grocy.nightly"/' app/build.gradle | |
sed -i 's|<string name="app_name" translatable="false">Grocy</string>|<string name="app_name" translatable="false">Grocy Nightly</string>|g' app/src/main/res/values/strings.xml | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '19' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Rename artifacts | |
run: | | |
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/Grocy-Android-master-$(date +'%Y%m%d').apk | |
cp app/src/main/res/raw/changelog.txt app/build/outputs/apk/debug/Grocy-Android-master-$(date +'%Y%m%d')-changelog.txt | |
- name: Upload artifacts | |
uses: pyTooling/Actions/releaser@r0 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
rm: true | |
tag: nightly | |
files: | | |
app/build/outputs/apk/debug/*.apk | |
app/build/outputs/apk/debug/*.txt | |
- name: Replace applicationId to default for checkout without git commit | |
run: | | |
sed -i 's/applicationId "xyz.zedler.patrick.grocy.nightly"/applicationId "xyz.zedler.patrick.grocy"/' app/build.gradle | |
sed -i 's|<string name="app_name" translatable="false">Grocy</string>|<string name="app_name" translatable="false">Grocy Nightly</string>|g' app/src/main/res/values/strings.xml | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
ref: 'feature/mlkit_scanner' | |
- name: Replace applicationId and name | |
run: | | |
sed -i 's/applicationId "xyz.zedler.patrick.grocy"/applicationId "xyz.zedler.patrick.grocy.nightly"/' app/build.gradle | |
sed -i 's%@string/app_name%Grocy Nightly%' app/src/main/AndroidManifest.xml | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Rename artifacts | |
run: | | |
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/Grocy-Android-mlkit-$(date +'%Y%m%d').apk | |
cp app/src/main/res/raw/changelog.txt app/build/outputs/apk/debug/Grocy-Android-mlkit-$(date +'%Y%m%d')-changelog.txt | |
- name: Upload artifacts | |
uses: pyTooling/Actions/releaser@r0 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
rm: false | |
tag: nightly | |
files: | | |
app/build/outputs/apk/debug/*.apk | |
app/build/outputs/apk/debug/*.txt |