-
-
Notifications
You must be signed in to change notification settings - Fork 18
86 lines (71 loc) · 2.54 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
name: Make release
permissions:
contents: write
on:
push:
tags:
- v*
jobs:
release-for-github:
name: "Release for GitHub and F-Droid"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build release with Gradle
run: ./gradlew assembleRelease
- name: Get tag ame
if: startsWith(github.ref, 'refs/tags/')
run: |
set -x
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Sign apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEYSTORE }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Copy build artifacts
run: |
set -e
declare -a apks=("universal" "arm64-v8a" "armeabi-v7a" "x86" "x86_64")
printf "%s\n" "${apks[@]}" | xargs -n 1 -I {} sh -c '
cp app/build/outputs/apk/release/app-{}-release-unsigned-signed.apk mpvKt-{}-${{ env.VERSION_TAG }}.apk
sha=$(sha256sum mpvKt-{}-${{ env.VERSION_TAG }}.apk | awk '\''{ print $1 }'\'')
echo "apk-{}-sha256=$sha" >> $GITHUB_ENV'
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_TAG }}
name: mpvKt ${{ env.VERSION_TAG }}
body: |
---
### Checksums
| Variant | SHA-256 |
| ------- | ------- |
| arm64-v8a | ${{ env.apk-arm64-v8a-sha256 }}
| armeabi-v7a | ${{ env.apk-armeabi-v7a-sha256 }}
| Universal | ${{ env.apk-universal-sha256 }}
| x86 | ${{ env.apk-x86-sha256 }}
| x86_64 | ${{ env.apk-x86_64-sha256 }} |
files: |
mpvKt-universal-${{ env.VERSION_TAG }}.apk
mpvKt-arm64-v8a-${{ env.VERSION_TAG }}.apk
mpvKt-armeabi-v7a-${{ env.VERSION_TAG }}.apk
mpvKt-x86-${{ env.VERSION_TAG }}.apk
mpvKt-x86_64-${{ env.VERSION_TAG }}.apk
prerelease: false
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}