-
-
Notifications
You must be signed in to change notification settings - Fork 312
62 lines (55 loc) · 2.52 KB
/
BuildRelease.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
name: Build Release
on:
release:
types: [published]
push:
tags:
- "*"
jobs:
build:
name: Build Arcticons APK
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: gradle
- name: Write sign info
run: |
echo "Workflow manually triggered by ${{ github.actor }}"
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Get Gradle
run: gradle wrapper
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Normal APK
run: ./gradlew app:assemblenormalRelease
- name: Build Black APK
run: ./gradlew app:assembleblackRelease
- name: Build You APK
run: ./gradlew app:assembleyouRelease
- name: Build Day&Night
run: ./gradlew app:assembledayNightRelease
- name: Get Release Notes
id: image
run: |
name=$(< ./generated/releaseName.txt)
name=$(echo $name | tr '\n' ' ')
image="![releaseImage](https://github.com/Arcticons-Team/Arcticons/blob/$GITHUB_REF_NAME/generated/releaseImage.jpg)"
changelog=$(< ./generated/changelog.md)
changelog="$changelog
$image"
gh release create $GITHUB_REF_NAME --generate-notes --title "$name" --notes "$changelog" --discussion-category "Announcements" app/build/outputs/apk/normal/release/*.apk app/build/outputs/apk/black/release/*.apk app/build/outputs/apk/dayNight/release/*.apk app/build/outputs/apk/you/release/*.apk
env:
GH_TOKEN: ${{ github.token }}