-
Notifications
You must be signed in to change notification settings - Fork 82
69 lines (57 loc) · 2.33 KB
/
on_master.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build Master
on:
workflow_dispatch:
push:
branches:
- master
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
run: ./gradlew clean build assemble :cli:fatJar --stacktrace
- name: Upload Code Coverage report
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./http/build/reports/jacoco/test/jacocoTestReport.xml
flags: unittests
- name: Prepare release
run: |
mkdir -p ./app/build/_release/android-http-server
mv ./app/build/outputs/apk/release/app-release-unsigned.apk ./app/build/_release/android-http-server/android-http-server-latest-unsigned.apk
mv ./cli/build/libs/cli-all.jar ./app/build/_release/android-http-server/android-http-server-cli-fatjar-latest.jar
- name: Upload APK to Dropbox
uses: deka0106/upload-to-dropbox@v2.0.0
with:
dropbox_access_token: ${{ secrets.DROPBOX_TOKEN }}
src: ./app/build/_release/android-http-server/android-http-server-latest-unsigned.apk
dest: /android-http-server/
mode: overwrite
- name: Upload CLI jar to Dropbox
uses: deka0106/upload-to-dropbox@v2.0.0
with:
dropbox_access_token: ${{ secrets.DROPBOX_TOKEN }}
src: ./app/build/_release/android-http-server/android-http-server-cli-fatjar-latest.jar
dest: /android-http-server/
mode: overwrite
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties