Skip to content

Commit d512444

Browse files
committed
rename
1 parent fbde1fe commit d512444

File tree

28 files changed

+779
-598
lines changed

28 files changed

+779
-598
lines changed

.github/workflows/cronet.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Update Cronet
22

33
on:
44
schedule:
5-
# 周一北京时间9点
5+
# 周一北京时间9点
66
- cron: 0 1 * * 1
77
workflow_dispatch:
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
if: ${{ github.repository == 'gedoor/legado' }}
12+
if: ${{ github.repository == 'LM-Firefly/YueDu-Firefly' }}
1313
steps:
1414
- uses: actions/checkout@v4
1515

.github/workflows/firefly.jks

2.52 KB
Binary file not shown.

.github/workflows/legado.jks

-2.18 KB
Binary file not shown.

.github/workflows/release.yml

+121-83
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,176 @@
11
name: Release Build
22

33
on:
4-
# push:
5-
# branches:
6-
# - master
7-
# paths:
8-
# - 'CHANGELOG.md'
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'CHANGELOG.md'
9+
pull_request:
910
workflow_dispatch:
11+
# watch:
12+
# types: [started]
13+
# schedule:
14+
# - cron: '0 4 * * *'
15+
16+
#concurrency:
17+
# group: ${{ github.ref }}-${{ github.workflow }}
18+
# cancel-in-progress: true
1019

1120
jobs:
1221
prepare:
1322
runs-on: ubuntu-latest
14-
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
23+
env:
24+
GIT_TOKEN: ${{secrets.ACTIONS_TOKEN}}
25+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
1526
outputs:
1627
version: ${{ steps.set-ver.outputs.version }}
17-
play: ${{ steps.check.outputs.play }}
18-
sign: ${{ steps.check.outputs.sign }}
28+
# play: ${{ steps.check.outputs.play }}
29+
# sign: ${{ steps.check.outputs.sign }}
1930
steps:
31+
- name: Setup timezone
32+
uses: hoang-rio/[email protected]
33+
with:
34+
timezoneLinux: 'Asia/Shanghai'
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
token: ${{env.GIT_TOKEN}}
2039
- id: set-ver
2140
run: |
22-
echo "version=$(date -d "8 hour" -u +3.%y.%m%d%H)" >> $GITHUB_OUTPUT
23-
- id: check
24-
run: |
25-
if [ ! -z "${{ secrets.RELEASE_KEY_STORE }}" ]; then
26-
echo "sign=yes" >> $GITHUB_OUTPUT
27-
fi
28-
if [ ! -z "${{ secrets.SERVICE_ACCOUNT_JSON }}" ]; then
29-
echo "play=yes" >> $GITHUB_OUTPUT
30-
fi
41+
echo "version=$(date -d "8 hour" -u +3.%y.%m%d%H%M)" >> $GITHUB_OUTPUT
42+
43+
# - id: check
44+
# run: |
45+
# if [ ! -z "${{ secrets.RELEASE_KEY_STORE }}" ]; then
46+
# echo "sign=yes" >> $GITHUB_OUTPUT
47+
# fi
48+
# if [ ! -z "${{ secrets.SERVICE_ACCOUNT_JSON }}" ]; then
49+
# echo "play=yes" >> $GITHUB_OUTPUT
50+
# fi
3151

3252
build:
3353
needs: prepare
34-
if: ${{ needs.prepare.outputs.sign }}
54+
# if: ${{ needs.prepare.outputs.sign }}
3555
strategy:
3656
matrix:
37-
product: [ app, google ]
57+
product: [Google]
58+
type: [Firefly, Original]
3859
fail-fast: false
3960
runs-on: ubuntu-latest
4061
env:
62+
GIT_TOKEN: ${{secrets.ACTIONS_TOKEN}}
4163
product: ${{ matrix.product }}
64+
type: ${{ matrix.type }}
4265
VERSION: ${{ needs.prepare.outputs.version }}
43-
play: ${{ needs.prepare.outputs.play }}
66+
# play: ${{ needs.prepare.outputs.play }}
4467
steps:
4568
- uses: actions/checkout@v4
46-
4769
- name: Set up JDK 17
4870
uses: actions/setup-java@v4
4971
with:
5072
distribution: 'temurin'
5173
java-version: 17
52-
53-
- name: Release Apk Sign
74+
- name: Clear 18PlusList.txt
5475
run: |
55-
# not use this output
56-
# echo "KeyStore=yes" >> $GITHUB_OUTPUT
57-
echo -e "\n" >> gradle.properties
58-
echo RELEASE_KEY_ALIAS='${{ secrets.RELEASE_KEY_ALIAS }}' >> gradle.properties
59-
echo RELEASE_KEY_PASSWORD='${{ secrets.RELEASE_KEY_PASSWORD }}' >> gradle.properties
60-
echo RELEASE_STORE_PASSWORD='${{ secrets.RELEASE_STORE_PASSWORD }}' >> gradle.properties
61-
echo RELEASE_STORE_FILE='./key.jks' >> gradle.properties
62-
echo ${{ secrets.RELEASE_KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/app/key.jks
63-
64-
- name: Unify Version Name
76+
echo "清空18PlusList.txt"
77+
echo "">$GITHUB_WORKSPACE/app/src/main/assets/18PlusList.txt
78+
- name: Release Apk Sign
6579
run: |
66-
echo "统一版本号"
67-
sed "/def version/c def version = \"${{ env.VERSION }}\"" $GITHUB_WORKSPACE/app/build.gradle -i
68-
80+
echo "给apk增加签名"
81+
cp $GITHUB_WORKSPACE/.github/workflows/firefly.jks $GITHUB_WORKSPACE/app/firefly.jks
82+
sed '$a\RELEASE_STORE_FILE=./firefly.jks' $GITHUB_WORKSPACE/gradle.properties -i
83+
sed '$a\RELEASE_KEY_ALIAS=YueDu-Firefly' $GITHUB_WORKSPACE/gradle.properties -i
84+
sed '$a\RELEASE_STORE_PASSWORD=YueDu-Firefly' $GITHUB_WORKSPACE/gradle.properties -i
85+
sed '$a\RELEASE_KEY_PASSWORD=YueDu-Firefly' $GITHUB_WORKSPACE/gradle.properties -i
6986
- name: Set up Gradle
7087
uses: gradle/actions/setup-gradle@v4
7188

7289
- name: Build With Gradle
7390
run: |
74-
echo "开始进行${{ env.product }}构建"
91+
if [ ${{ env.type }} == 'Original' ]; then
92+
typeName="Original"
93+
sed "s/'.release'/'.Original'/" $GITHUB_WORKSPACE/app/build.gradle -i
94+
sed 's/.release/.Original/' $GITHUB_WORKSPACE/app/google-services.json -i
95+
else
96+
typeName="Firefly"
97+
sed "s/'.release'/'.Firefly'/" $GITHUB_WORKSPACE/app/build.gradle -i
98+
sed 's/.release/.Firefly/' $GITHUB_WORKSPACE/app/google-services.json -i
99+
fi
100+
echo "统一版本号"
101+
sed "/def version/c def version = \"${{ env.VERSION }}\"" $GITHUB_WORKSPACE/app/build.gradle -i
102+
echo "开始进行${{ env.product }}.$typeName构建"
75103
chmod +x gradlew
76104
./gradlew assemble${{ env.product }}release --build-cache --parallel --daemon --warning-mode all
77-
78-
- name: Organize the Files
79-
run: |
105+
echo "修改文件名"
80106
mkdir -p ${{ github.workspace }}/apk/
81-
cp -rf ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk ${{ github.workspace }}/apk/
82-
107+
for file in `ls ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk`; do
108+
mv "$file" ${{ github.workspace }}/apk/YueDu.${{ env.product }}.$typeName.${{ env.VERSION }}.apk
109+
done
83110
- name: Upload App To Artifact
84-
uses: actions/upload-artifact@v4
111+
uses: actions/upload-artifact@v4.3.1
85112
with:
86-
name: legado_${{ env.product }}
113+
name: YueDu.${{ env.product }}.${{ env.type }}
87114
path: ${{ github.workspace }}/apk/*.apk
88-
89115
- name: Release
90-
if: ${{ env.product == 'app' }}
91-
uses: softprops/action-gh-release@v2
116+
# if: ${{ env.product == 'Google' }}
117+
uses: softprops/action-gh-release@v2.0.8
92118
with:
93-
name: legado_app_${{ env.VERSION }}
119+
name: YueDu.${{ env.VERSION }}
94120
tag_name: ${{ env.VERSION }}
95-
body_path: ${{ github.workspace }}/CHANGELOG.md
121+
# body: ${{ env.CHANGE }}
122+
body_path: ${{ github.workspace }}/app/src/main/assets/updateLog.md
123+
generate_release_notes: true
124+
# append_body: true
125+
token: ${{env.GIT_TOKEN}}
96126
draft: false
97127
prerelease: false
98-
files: ${{ github.workspace }}/apk/legado_app_*.apk
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
102-
- name: Prepare For GooglePlay
103-
if: env.product == 'google' && env.play == 'yes'
104-
run: |
105-
mkdir -p ReleaseNotes
106-
ln -s ${{ github.workspace }}/CHANGELOG.md ReleaseNotes/whatsnew-en-US
107-
ln -s ${{ github.workspace }}/CHANGELOG.md ReleaseNotes/whatsnew-zh-CN
128+
files: ${{ github.workspace }}/apk/YueDu.*.apk
108129

109-
- name: Release To GooglePlay
110-
if: env.product == 'google' && env.play == 'yes'
111-
uses: r0adkll/upload-google-play@v1
112-
with:
113-
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
114-
packageName: io.legado.play
115-
releaseFiles: ${{ github.workspace }}/apk/legado_google_*.apk
116-
track: production
117-
whatsNewDirectory: ${{ github.workspace }}/ReleaseNotes
130+
# - name: Prepare For GooglePlay
131+
# if: env.product == 'Google' && env.play == 'yes'
132+
# run: |
133+
# mkdir -p ReleaseNotes
134+
# ln -s ${{ github.workspace }}/CHANGELOG.md ReleaseNotes/whatsnew-en-US
135+
# ln -s ${{ github.workspace }}/CHANGELOG.md ReleaseNotes/whatsnew-zh-CN
136+
#
137+
# - name: Release To GooglePlay
138+
# if: env.product == 'google' && env.play == 'yes'
139+
# uses: r0adkll/upload-google-play@v1
140+
# with:
141+
# serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
142+
# packageName: io.legado.play
143+
# releaseFiles: ${{ github.workspace }}/apk/YueDu.Google.*.apk
144+
# track: production
145+
# whatsNewDirectory: ${{ github.workspace }}/ReleaseNotes
146+
147+
# release_Branch:
148+
# needs: [prepare, build]
149+
# runs-on: ubuntu-latest
150+
# if: ${{ github.actor == 'LM-Firefly' }}
151+
# steps:
152+
# - uses: actions/checkout@v4
153+
# - uses: actions/download-artifact@v4
154+
# with:
155+
# path: apk/
156+
# - working-directory: apk/
157+
# run: mv */*.apk . ;rm -rf */
158+
# - name: Push Assets To "release" Branch
159+
# run: |
160+
# cd $GITHUB_WORKSPACE/apk/
161+
# git config --global user.name "github-actions[bot]"
162+
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
163+
# git init
164+
# git checkout -b release
165+
# git remote add origin "https://${{ github.actor }}:${{ secrets.ACTIONS_TOKEN }}@github.com/${{ github.actor }}/${{ github.repository }}/release"
166+
# git add *.apk
167+
# git commit -m "${{ env.VERSION }}"
168+
# git push -f -u origin release
118169

119-
- name: Push Assets To "release" Branch
120-
if: ${{ github.actor == 'gedoor' }}
121-
run: |
122-
cd $GITHUB_WORKSPACE/apk/
123-
git init
124-
git checkout -b release
125-
git config --global user.name "github-actions[bot]"
126-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
127-
git remote add origin "https://${{ github.actor }}:${{ secrets.ACTIONS_TOKEN }}@github.com/${{ github.actor }}/release"
128-
git add *.apk
129-
git commit -m "${{ env.VERSION }}"
130-
git push -f -u origin release
131-
132170
- name: Purge Jsdelivr Cache
133-
if: ${{ github.actor == 'gedoor' }}
171+
if: ${{ github.actor == 'LM-Firefly' }}
134172
run: |
135-
result=$(curl -s https://purge.jsdelivr.net/gh/${{ github.actor }}/release@release/)
173+
result=$(curl -s https://purge.jsdelivr.net/gh/${{ github.actor }}/${{ github.repository }}/release@release/)
136174
if echo $result |grep -q 'success.*true'; then
137175
echo "jsdelivr缓存更新成功"
138176
else

0 commit comments

Comments
 (0)