-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 1.51 KB
/
release-apk.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release Juicy Noise Android application
on:
push:
tags:
- '*'
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Format ref
id: format-ref
shell: bash
run: |
sha_short="$(echo "${{ github.sha }}" | head -c 8)"
ref="${sha_short}"
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
ref="${{ github.ref_name }}"
fi
echo "::set-output name=value::${ref}"
- name: Restore Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Build Android client
run: |
pushd "juicy-noise-android"
./gradlew assembleDebug
popd
mv \
"juicy-noise-android/app/build/outputs/apk/debug/app-debug.apk" \
"juicy-noise-${{ steps.format-ref.outputs.value }}.apk"
- name: Upload artifacts for Android
uses: actions/upload-artifact@v3
with:
name: apk
path: '*.apk'
if-no-files-found: error
retention-days: 2
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: '${{ secrets._GITHUB_PAT }}'
files: '*.apk'