-
Notifications
You must be signed in to change notification settings - Fork 1.5k
184 lines (157 loc) · 6.59 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Build
on:
push:
branches:
- master
jobs:
Android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Setup Env
uses: ./.github/actions/setup
- name: Build Packages
shell: bash
run: |
cd android
echo ${{ secrets.KEYSTORE_STORE_FILE_BASE64 }} | base64 --decode > app/${{ secrets.KEYSTORE_STORE_FILE }}
./gradlew assembleRelease -PMYAPP_UPLOAD_STORE_FILE='${{ secrets.KEYSTORE_STORE_FILE }}' -PMYAPP_UPLOAD_KEY_ALIAS='${{ secrets.KEYSTORE_KEY_ALIAS }}' -PMYAPP_UPLOAD_STORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}' -PMYAPP_UPLOAD_KEY_PASSWORD='${{ secrets.KEYSTORE_KEY_PASSWORD }}'
rm -f app/${{ secrets.KEYSTORE_STORE_FILE }}
# Push tag to GitHub if package.json version's tag is not tagged
- name: Get package version
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Create git tag
uses: pkgdeps/git-tag-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
- name: Generate file MD5
run: |
cd android/app/build/outputs/apk/release
md5sum *.apk
- name: Upload Artifact
uses: ./.github/actions/upload-artifact
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
Android_SL:
name: Android_SL
runs-on: ubuntu-latest
steps:
- name: Check out git repository
uses: actions/checkout@v4
with:
ref: statusbar_lyric
- name: Setup Env
uses: ./.github/actions/setup
- name: Build Packages
shell: bash
run: |
cd android
echo ${{ secrets.KEYSTORE_STORE_FILE_BASE64 }} | base64 --decode > app/${{ secrets.KEYSTORE_STORE_FILE }}
./gradlew assembleRelease -PMYAPP_UPLOAD_STORE_FILE='${{ secrets.KEYSTORE_STORE_FILE }}' -PMYAPP_UPLOAD_KEY_ALIAS='${{ secrets.KEYSTORE_KEY_ALIAS }}' -PMYAPP_UPLOAD_STORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}' -PMYAPP_UPLOAD_KEY_PASSWORD='${{ secrets.KEYSTORE_KEY_PASSWORD }}'
rm -f app/${{ secrets.KEYSTORE_STORE_FILE }}
# Push tag to GitHub if package.json version's tag is not tagged
- name: Get package version
run: |
node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
echo "COMMIT_SHA=$(git show -s --format=%H)" >> $GITHUB_ENV
- name: Create git tag
uses: pkgdeps/git-tag-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ env.COMMIT_SHA }}
git_tag_prefix: "v"
- name: Generate file MD5
run: |
echo "current commit sha: ${{ env.COMMIT_SHA }}"
cd android/app/build/outputs/apk/release
md5sum *.apk
- name: Upload Artifact
uses: ./.github/actions/upload-artifact
env:
PACKAGE_TYPE: 'Android_SL'
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
# Android_5:
# name: Android_5
# runs-on: ubuntu-latest
# steps:
# - name: Check out git repository
# uses: actions/checkout@v4
# with:
# ref: android_5
# - name: Setup Env
# uses: ./.github/actions/setup
# - name: Build Packages
# shell: bash
# run: |
# cd android
# echo ${{ secrets.KEYSTORE_STORE_FILE_BASE64 }} | base64 --decode > app/${{ secrets.KEYSTORE_STORE_FILE }}
# ./gradlew assembleRelease -PMYAPP_UPLOAD_STORE_FILE='${{ secrets.KEYSTORE_STORE_FILE }}' -PMYAPP_UPLOAD_KEY_ALIAS='${{ secrets.KEYSTORE_KEY_ALIAS }}' -PMYAPP_UPLOAD_STORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}' -PMYAPP_UPLOAD_KEY_PASSWORD='${{ secrets.KEYSTORE_KEY_PASSWORD }}'
# rm -f app/${{ secrets.KEYSTORE_STORE_FILE }}
# # Push tag to GitHub if package.json version's tag is not tagged
# - name: Get package version
# run: |
# node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
# echo "COMMIT_SHA=$(git show -s --format=%H)" >> $GITHUB_ENV
# - name: Create git tag
# uses: pkgdeps/git-tag-action@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# github_repo: ${{ github.repository }}
# version: ${{ env.PACKAGE_VERSION }}
# git_commit_sha: ${{ env.COMMIT_SHA }}
# git_tag_prefix: "v"
# - name: Generate file MD5
# run: |
# echo "current commit sha: ${{ env.COMMIT_SHA }}"
# cd android/app/build/outputs/apk/release
# md5sum *.apk
# - name: Upload Artifact
# uses: ./.github/actions/upload-artifact
# env:
# PACKAGE_TYPE: 'Android_5'
# PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
Release:
name: Release
runs-on: ubuntu-latest
needs: [Android, Android_SL]
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
merge-multiple: true
- name: Generate file MD5
run: |
echo -e '\n### File MD5\n```' >> ./publish/changeLog.md
cd artifacts
md5sum *.apk >> ../publish/changeLog.md
echo -e '```\n' >> ../publish/changeLog.md
- name: Get package version
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ./publish/changeLog.md
prerelease: false
draft: false
tag_name: v${{ env.PACKAGE_VERSION }}
files: |
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-arm64-v8a.apk
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-armeabi-v7a.apk
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-x86_64.apk
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-x86.apk
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-universal.apk
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-sl-arm64-v8a.apk
# artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-android_5-universal.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}