-
Notifications
You must be signed in to change notification settings - Fork 6
134 lines (113 loc) · 3.46 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Android Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+**
workflow_dispatch:
env:
VERSION_BRANCH: version
VERSION_FILE: version.properties
ARTIFACT_APK: release.apk
ARTIFACT_MAPPINGS: mappings
jobs:
build:
runs-on: ubuntu-latest
env:
QNEVO_SIGNING_STORE_PATH: ${{ github.workspace }}/release.jks
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Write KeyStore File
uses: RollyPeres/base64-to-path@v1
with:
filePath: ${{ env.QNEVO_SIGNING_STORE_PATH }}
encodedString: ${{ secrets.SIGNING_KEYSTORE }}
- name: Assemble Release APK
run: ./gradlew assembleRelease
env:
QNEVO_SIGNING_STORE_PWD: ${{ secrets.SIGNING_STORE_PASSWORD }}
QNEVO_SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
QNEVO_SIGNING_KEY_PWD: ${{ secrets.SIGNING_KEY_PASSWORD }}
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_APK }}
path: "app/build/outputs/apk/release/app-release.apk"
if-no-files-found: error
- name: Upload Mapping Files
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_MAPPINGS }}
path: "app/build/outputs/mapping/release"
if-no-files-found: error
- name: Generate Version Info
run: ./gradlew appVersion
- name: Upload version.properties
uses: actions/upload-artifact@v3
with:
name: ${{ env.VERSION_FILE }}
path: ${{ env.VERSION_FILE }}
if-no-files-found: error
retention-days: 1
draft-release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download APK
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_APK }}
- name: Download Mappings
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_MAPPINGS }}
path: mappings
- name: Tar Mapping Files
run: |
cd mappings
tar -zcf mappings.tar.gz ./*
mv mappings.tar.gz ../
cd ..
- name: Release
uses: ncipollo/release-action@v1
with:
draft: true
artifactErrorsFailBuild: true
artifacts: "app-release.apk,mappings.tar.gz"
# commit the version file to 'version' branch so that F-Droid can utilize it for new version detecting
update-version:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Checkout version branch
uses: actions/checkout@v4
with:
ref: ${{ env.VERSION_BRANCH }}
fetch-depth: 0
- name: Delete version.properties
run: rm -f $VERSION_FILE
- name: Download version.properties
uses: actions/download-artifact@v3
with:
name: ${{ env.VERSION_FILE }}
- name: Show version info
run: cat $VERSION_FILE
- name: Commit and push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update version.properties
push_options: '--force'
skip_fetch: true