-
Notifications
You must be signed in to change notification settings - Fork 1.2k
98 lines (81 loc) · 2.8 KB
/
Build-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
name: Build-Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: write secrets info
run: |
echo ${{ secrets.GKD_STORE_FILE_BASE64 }} | base64 --decode > ${{ github.workspace }}/key.jks
echo GKD_STORE_FILE='${{ github.workspace }}/key.jks' >> gradle.properties
echo GKD_STORE_PASSWORD='${{ secrets.GKD_STORE_PASSWORD }}' >> gradle.properties
echo GKD_KEY_ALIAS='${{ secrets.GKD_KEY_ALIAS }}' >> gradle.properties
echo GKD_KEY_PASSWORD='${{ secrets.GKD_KEY_PASSWORD }}' >> gradle.properties
- run: chmod 777 ./gradlew
- run: ./gradlew app:assembleRelease
- uses: actions/upload-artifact@v4
with:
name: outputs
path: app/build/outputs
- uses: actions/upload-artifact@v4
with:
name: gkd-release
path: app/build/outputs/apk/gkd/release
- uses: actions/upload-artifact@v4
with:
name: foss-release
path: app/build/outputs/apk/foss/release
- uses: actions/upload-artifact@v4
with:
name: CHANGELOG.md
path: CHANGELOG.md
release:
needs: build
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: outputs
path: outputs
- uses: actions/download-artifact@v4
with:
name: CHANGELOG.md
- run: ls -R
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body_path: ./CHANGELOG.md
prerelease: ${{ contains(github.ref_name, 'beta') }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: outputs/apk/gkd/release/app-gkd-release.apk
asset_name: gkd-${{ github.ref_name }}.apk
asset_content_type: application/vnd.android.package-archive
- run: zip -r outputs.zip outputs
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: outputs.zip
asset_name: outputs-${{ github.ref_name }}.zip
asset_content_type: application/zip