-
-
Notifications
You must be signed in to change notification settings - Fork 62
71 lines (59 loc) · 2.42 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
# Generates and uploads a release version when a new tag is pushed
name: Create release
on:
# trigger for tags starting with 'v'
push:
tags:
- v*
# Run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Get the repository files
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
- name: Create release store file
run: |
RELEASE_STORE_FILE=$(readlink -f release_store_file)
echo -n "$RELEASE_STORE_FILE_ENCRYPTED" | base64 --decode > $RELEASE_STORE_FILE
echo "RELEASE_STORE_FILE=$RELEASE_STORE_FILE" >> "$GITHUB_ENV"
env:
RELEASE_STORE_FILE_ENCRYPTED: ${{ secrets.RELEASE_STORE_FILE }}
- name: Build & assemble
run: ./gradlew build assembleRelease
env:
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
path: ./app/build/outputs/apk/release/*.apk
- name: Upload apk to release with the release notes
if: ${{ github.event_name == 'push' }}
run: |
(
sed '/^$/q' ./app/src/main/play/release-notes/en-US/default.txt
cat - << EOF
---
- App package: \`com.trianguloy.urlchecker\`
- SHA-256 Hash of Signing Certificate:
- \`BF:1B:69:C1:4D:A2:42:0C:A7:20:11:F7:2C:F4:83:74:58:EC:5D:3C:C4:B5:38:24:34:37:BC:17:C1:92:01:C6\`
Note: All three different versions (Play Store, F-droid and Github) are signed with different certificates, so you cannot update one with another unless you uninstall first.
Remember to use the backup/restore functionality to migrate your data!
EOF
) | gh release create $TAG ./app/build/outputs/apk/release/*.apk --title="URLCheck ${TAG#v} release apk" --latest --verify-tag --notes-file -
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}