-
Notifications
You must be signed in to change notification settings - Fork 25
103 lines (87 loc) · 2.93 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
name: Release CI
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Force fetch Tags
run: |
git fetch --tags --force
- name: Get Tag
id: var
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
echo ::set-output name=version::${GITHUB_REF#refs/*/v}
- name: set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Write key
run: |
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then
echo STORE_PASSWORD='${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties
echo KEY_ALIAS='${{ secrets.ALIAS }}' >> local.properties
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties
echo STORE_FILE_PATH='../release.keystore' >> local.properties
echo ${{ secrets.SIGNING_KEY }} | base64 --decode > release.keystore
fi
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease
- name: Collect artifcat name
run: |
echo "release_artifact=$(basename -s .apk app/build/outputs/apk/release/*.apk)" >> $GITHUB_ENV
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.release_artifact }}
path: app/build/outputs/apk/release/*.apk
- name: Upload Mapping
uses: actions/upload-artifact@v3
with:
name: mapping
path: app/build/outputs/mapping/release/mapping.txt
- uses: ericcornelissen/git-tag-annotation-action@v2
id: tag-data
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.var.outputs.tag }}
token: ${{ secrets.GH_TOKEN }}
body: ${{ steps.tag-data.outputs.git-tag-annotation }}
artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/mapping/release/mapping.txt"
allowUpdates: true
removeArtifacts: true
- name: Draft Release to XPosed Repo
uses: ncipollo/release-action@v1
with:
name: ${{ steps.var.outputs.tag }}
tag: ${{ steps.var.outputs.version }}
commit: main
owner: Xposed-Modules-Repo
repo: one.yufz.hmspush
token: ${{ secrets.GH_TOKEN }}
body: ${{ steps.tag-data.outputs.git-tag-annotation }}
artifacts: "app/build/outputs/apk/release/*.apk"
draft: true
allowUpdates: true
removeArtifacts: true
- name: Release to XPosed Repo
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.var.outputs.version }}
allowUpdates: true
owner: Xposed-Modules-Repo
repo: one.yufz.hmspush
token: ${{ secrets.GH_TOKEN }}
omitNameDuringUpdate: true
omitBodyDuringUpdate: true