-
Notifications
You must be signed in to change notification settings - Fork 238
55 lines (47 loc) · 1.53 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Nightly APK
on:
schedule: # Scheduled jobs only run on the default repository branch
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
default: 'develop'
required: true
jobs:
nightly_build:
name: Nightly build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug --stacktrace
- name: Rename output APK
run: |
DATE=$(date +'%Y%m%d%H%M')
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/OSMTracker-nightly-$DATE.apk
- name: Delete existing Nightly release
run: gh release delete nightly --cleanup-tag --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Nightly Release
uses: softprops/[email protected]
with:
tag_name: 'nightly'
name: 'Nightly Build'
draft: false
prerelease: true
files: app/build/outputs/apk/debug/OSMTracker-nightly-*.apk
body: "Nightly build for OSMTracker"
token: ${{ secrets.GITHUB_TOKEN }}