-
-
Notifications
You must be signed in to change notification settings - Fork 66
117 lines (101 loc) · 3.55 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Release Build
on:
push:
tags:
- 'v*'
jobs:
Build:
name: Build/Sign APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup last build tool version
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- name: Set GOOGLE_API_KEY in local properties
run: echo 'GOOGLE_API_KEY="${{ secrets.GOOGLE_API_KEY }}"' >> ./local.properties
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Get Tag
id: var
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Build APK
id: build
run: bash ./gradlew assembleRelease
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.BASE64KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Make artifact
uses: actions/upload-artifact@v4
with:
name: Signed APP APK
path: ${{steps.sign_apk.outputs.signedReleaseFile}}
- name: Build AAB
run: bash ./gradlew bundleRelease
- name: Sign AAB
id: sign_aab
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.BASE64KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Make artifact
uses: actions/upload-artifact@v4
with:
name: Signed APP Bundle
path: ${{steps.sign_aab.outputs.signedReleaseFile}}
- name: Build Changelog
id: changelog
uses: ardalanamini/auto-changelog@v3
with:
mention-authors: false
mention-new-contributors: true
include-compare: true
semver: false
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Myne ${{ github.ref }}
draft: true
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: Myne-${{ steps.var.outputs.tag }}.apk
asset_content_type: application/zip
- name: Upload AAB
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{steps.sign_aab.outputs.signedReleaseFile}}
asset_name: Myne-${{ steps.var.outputs.tag }}.aab
asset_content_type: application/zip