forked from mason-Wang/android-httpserver
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (51 loc) · 1.88 KB
/
android.yml
File metadata and controls
56 lines (51 loc) · 1.88 KB
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
# This workflow builds the release variant of the project and uploads it to a newly created release
# It is triggered by the creation of a tag named 'release/v*', e.g. 'release/v1.0.0'
# The <MY RELEASE NOTES> placeholder has to be replaced with the real release notes
# Please note that the KeyStore credentials have to be created as secrets in your project
# For more information about best practices, see:
# https://grandcentrix.atlassian.net/wiki/spaces/TENG/pages/31180230199/GitHub+Actions+Best+Practices
name: Build Release
on:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_release:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.1.0
- name: Set up JDK 8
uses: actions/setup-java@v3.6.0
with:
distribution: 'adopt'
java-version: 8
- name: Cache gradle wrapper and packages
uses: actions/cache@v3.0.11
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Build Release
run: ./gradlew assembleRelease
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
ALIAS_PASSWORD: ${{ secrets.ALIAS_PASSWORD }}
timeout-minutes: 10
- name: Gzip
run: |
mkdir -p app/build/outputs/apk/release/
cp `find -name *.apk` app/build/outputs/apk/release/
tar -czvf http-server.tar.gz app/build/outputs/apk/release/
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: http-server.tar.gz application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}