-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (52 loc) · 2.01 KB
/
release.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
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK Tools
uses: android-actions/[email protected]
- name: Build release APK
run: |
./gradlew assembleRelease
$ANDROID_SDK_ROOT/build-tools/35.0.0/zipalign -v -p 4 app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release-unsigned-aligned.apk
echo "${{ secrets.KEYSTORE_FILE }}" | base64 -d > keystore.jks
echo "${{ secrets.KEYSTORE_PASSWORD }}" | $ANDROID_SDK_ROOT/build-tools/35.0.0/apksigner sign --ks keystore.jks --out app-release.apk app/build/outputs/apk/release/app-release-unsigned-aligned.apk
$ANDROID_SDK_ROOT/build-tools/35.0.0/apksigner verify app-release.apk
- name: Parse tag
id: parse_tag
run: "echo ${{ github.ref }} | sed 's#^refs/tags/#::set-output name=version::#'"
- name: Create release
id: create_release
uses: release-drafter/release-drafter@v6
with:
name: ${{ steps.parse_tag.outputs.version }}
tag: ${{ steps.parse_tag.outputs.version }}
version: ${{ steps.parse_tag.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./app-release.apk
asset_name: nanoledger-${{ steps.create_release.outputs.tag_name }}.apk
asset_content_type: application/vnd.android.package-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}