-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (89 loc) · 3.15 KB
/
release_feature_github.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release Build
on:
push:
tags:
- 'v*'
jobs:
Build:
name: Build/Sign APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 19
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'corretto'
cache: gradle
- name: Get Tag
id: var
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > keystore.jks.b64
base64 -d -i keystore.jks.b64 > app/keystore.jks
echo "keystoreFile=keystore.jks" >> signing.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> signing.properties
echo "keystorePassword=$KEYSTORE_STORE_PASSWORD" >> signing.properties
echo "::debug::storePassword=$KEYSTORE_STORE_PASSWORD"
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> signing.properties
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Build APK
id: build
run: bash ./gradlew assembleRelease
env:
VERSION_CODE: ${{ env.GITHUB_RUN_NUMBER }}
VERSION_NAME: ${{ github.event.inputs.versionName }}
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE_FILE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Make artifact
uses: actions/upload-artifact@v2
with:
name: app-release-signed
path: ${{steps.sign_apk.outputs.signedReleaseFile}}
- name: Build Changelog
id: changelog
uses: ardalanamini/auto-changelog@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-types: |
feat: New Features
fix: Bug Fixes
build: Build System & Dependencies
perf: Performance Improvements
docs: Documentation
test: Tests
refactor: Refactors
chore: Chores
ci: CI
style: Code Style
revert: Reverts
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.changelog }} ;
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload APK
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{steps.sign_apk.outputs.signedReleaseFile}}
asset_name: app-release-signed-${{ steps.var.outputs.tag }}.apk
asset_content_type: application/zip