Skip to content

Commit eda98db

Browse files
authored
Merge pull request #955 from EstrellaXD/3.2-dev
3.2.0
2 parents 81b3a4a + d288994 commit eda98db

295 files changed

Lines changed: 35129 additions & 11077 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build Docker
33
on:
44
pull_request:
55
types:
6+
- opened
7+
- synchronize
68
- closed
79
branches:
810
- main
@@ -13,20 +15,19 @@ jobs:
1315
runs-on: ubuntu-latest
1416
steps:
1517
- uses: actions/checkout@v4
16-
- name: Set up Python 3.11
17-
uses: actions/setup-python@v3
18+
- name: Set up Python 3.13
19+
uses: actions/setup-python@v5
1820
with:
19-
python-version: '3.11'
21+
python-version: "3.13"
22+
- uses: astral-sh/setup-uv@v4
23+
with:
24+
version: "latest"
2025
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
if [ -f backend/requirements.txt ]; then pip install -r backend/requirements.txt; fi
24-
pip install pytest
26+
run: cd backend && uv sync --group dev
2527
- name: Test
26-
working-directory: ./backend/src
2728
run: |
28-
mkdir -p config
29-
pytest
29+
mkdir -p backend/config
30+
cd backend && uv run pytest src/test -v
3031
3132
webui-test:
3233
runs-on: ubuntu-latest
@@ -104,20 +105,30 @@ jobs:
104105
else
105106
echo "version=Test" >> $GITHUB_OUTPUT
106107
fi
108+
- name: If build test
109+
id: build_test
110+
run: |
111+
if [[ '${{ github.event_name }}' == 'pull_request' && '${{ github.event.pull_request.merged }}' != 'true' && '${{ github.event.pull_request.head.ref }}' == *'dev'* ]]; then
112+
echo "build_test=1" >> $GITHUB_OUTPUT
113+
else
114+
echo "build_test=0" >> $GITHUB_OUTPUT
115+
fi
107116
- name: Check result
108117
run: |
109118
echo "release: ${{ steps.release.outputs.release }}"
110119
echo "dev: ${{ steps.dev.outputs.dev }}"
120+
echo "build_test: ${{ steps.build_test.outputs.build_test }}"
111121
echo "version: ${{ steps.version.outputs.version }}"
112122
outputs:
113123
release: ${{ steps.release.outputs.release }}
114124
dev: ${{ steps.dev.outputs.dev }}
125+
build_test: ${{ steps.build_test.outputs.build_test }}
115126
version: ${{ steps.version.outputs.version }}
116127

117128
build-webui:
118129
runs-on: ubuntu-latest
119130
needs: [test, webui-test, version-info]
120-
if: ${{ needs.version-info.outputs.release == 1 || needs.version-info.outputs.dev == 1 }}
131+
if: ${{ needs.version-info.outputs.release == 1 || needs.version-info.outputs.dev == 1 || needs.version-info.outputs.build_test == 1 }}
121132
steps:
122133
- name: Checkout
123134
uses: actions/checkout@v4
@@ -154,14 +165,15 @@ jobs:
154165
cd webui && pnpm build
155166
156167
- name: Upload artifact
157-
uses: actions/upload-artifact@v3
168+
uses: actions/upload-artifact@v4
158169
with:
159170
name: dist
160171
path: webui/dist
161172

162173
build-docker:
163174
runs-on: ubuntu-latest
164175
needs: [build-webui, version-info]
176+
if: ${{ needs.version-info.outputs.release == 1 || needs.version-info.outputs.dev == 1 || needs.version-info.outputs.build_test == 1 }}
165177
steps:
166178
- name: Checkout
167179
uses: actions/checkout@v4
@@ -219,7 +231,7 @@ jobs:
219231
password: ${{ secrets.ACCESS_TOKEN }}
220232

221233
- name: Download artifact
222-
uses: actions/download-artifact@v3
234+
uses: actions/download-artifact@v4
223235
with:
224236
name: dist
225237
path: backend/src/dist
@@ -230,7 +242,7 @@ jobs:
230242
with:
231243
context: .
232244
builder: ${{ steps.buildx.output.name }}
233-
platforms: linux/amd64,linux/arm64,linux/arm/v7
245+
platforms: linux/amd64,linux/arm64
234246
push: True
235247
tags: ${{ steps.meta.outputs.tags }}
236248
labels: ${{ steps.meta.outputs.labels }}
@@ -243,7 +255,7 @@ jobs:
243255
with:
244256
context: .
245257
builder: ${{ steps.buildx.output.name }}
246-
platforms: linux/amd64,linux/arm64,linux/arm/v7
258+
platforms: linux/amd64,linux/arm64
247259
push: ${{ github.event_name == 'push' }}
248260
tags: ${{ steps.meta-dev.outputs.tags }}
249261
labels: ${{ steps.meta-dev.outputs.labels }}
@@ -256,7 +268,7 @@ jobs:
256268
with:
257269
context: .
258270
builder: ${{ steps.buildx.output.name }}
259-
platforms: linux/amd64,linux/arm64,linux/arm/v7
271+
platforms: linux/amd64,linux/arm64
260272
push: false
261273
tags: estrellaxd/auto_bangumi:test
262274
cache-from: type=gha, scope=${{ github.workflow }}
@@ -274,7 +286,7 @@ jobs:
274286
uses: actions/checkout@v4
275287

276288
- name: Download artifact webui
277-
uses: actions/download-artifact@v3
289+
uses: actions/download-artifact@v4
278290
with:
279291
name: dist
280292
path: webui/dist
@@ -284,7 +296,7 @@ jobs:
284296
cd webui && ls -al && tree && zip -r dist.zip dist
285297
286298
- name: Download artifact app
287-
uses: actions/download-artifact@v3
299+
uses: actions/download-artifact@v4
288300
with:
289301
name: dist
290302
path: backend/src/dist
@@ -295,10 +307,6 @@ jobs:
295307
echo ${{ needs.version-info.outputs.version }}
296308
echo "VERSION='${{ needs.version-info.outputs.version }}'" >> module/__version__.py
297309
298-
- name: Copy requirements.txt
299-
working-directory: ./backend
300-
run: cp requirements.txt src/requirements.txt
301-
302310
- name: Zip app
303311
run: |
304312
cd backend && zip -r app-v${{ needs.version-info.outputs.version }}.zip src
@@ -314,13 +322,22 @@ jobs:
314322
echo "pre_release=false" >> $GITHUB_OUTPUT
315323
fi
316324
325+
- name: Read changelog
326+
id: changelog
327+
run: |
328+
if [ -f docs/changelog/3.2.md ]; then
329+
echo "body<<EOF" >> $GITHUB_OUTPUT
330+
cat docs/changelog/3.2.md >> $GITHUB_OUTPUT
331+
echo "EOF" >> $GITHUB_OUTPUT
332+
fi
333+
317334
- name: Release
318335
id: release
319336
uses: softprops/action-gh-release@v1
320337
with:
321338
tag_name: ${{ needs.version-info.outputs.version }}
322339
name: ${{ steps.release-info.outputs.version }}
323-
body: ${{ github.event.pull_request.body }}
340+
body: ${{ github.event.pull_request.body || steps.changelog.outputs.body }}
324341
draft: false
325342
prerelease: ${{ steps.release-info.outputs.pre_release == 'true' }}
326343
files: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,7 @@ dev-dist
216216

217217
# test file
218218
test.*
219+
220+
# local config
221+
/backend/config/
222+
.claude/settings.local.json

0 commit comments

Comments
 (0)