Skip to content

Commit a916854

Browse files
authored
Update ci.yml
1 parent ff97128 commit a916854

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
name: Build Python-miio for ARMv7 using Docker and QEMU
2-
32
on:
43
push:
54
branches:
6-
- main # 自动触发条件:当 main 分支有新的提交时
5+
- main
76
pull_request:
87
branches:
9-
- main # 自动触发条件:当有 PR 合并到 main 分支时
10-
workflow_dispatch: # 手动触发条件
8+
- main
9+
workflow_dispatch:
1110
schedule:
12-
- cron: '0 0 * * 1' # 每周一 00:00 UTC 触发
13-
11+
- cron: '0 0 * * 1'
1412
jobs:
1513
build:
1614
runs-on: ubuntu-latest
1715
steps:
1816
- name: Checkout code
1917
uses: actions/checkout@v2
20-
2118
- name: Set up QEMU for ARM
2219
uses: docker/setup-qemu-action@v2
2320
with:
2421
platforms: arm
25-
2622
- name: Register QEMU static binaries
2723
run: |
2824
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
29-
3025
- name: Build and run in ARMv7 container
3126
run: |
3227
docker run --rm --platform linux/arm/v7 -v $(pwd):/workspace -w /workspace arm32v7/python:3 \
@@ -38,27 +33,25 @@ jobs:
3833
export PATH=\$HOME/.cargo/bin:\$PATH && \
3934
python -m venv venv && \
4035
. venv/bin/activate && \
41-
cp ./python-miio-git/* ./venv/
36+
cp ./python-miio-git/* ./venv/ && \
4237
pip install --upgrade pip && \
4338
pip install git+https://github.com/rytilahti/python-miio.git && \
4439
python -c 'import miio; print(miio.__version__)' > version.txt && \
4540
pip freeze > requirements.txt
4641
"
47-
4842
- name: Archive virtual environment
4943
run: |
5044
tar -czvf python-miio-git.tar.gz venv/
51-
5245
- name: Upload artifact
5346
uses: actions/upload-artifact@v4
5447
with:
5548
name: python-miio-git
5649
path: |
5750
python-miio-git.tar.gz
5851
version.txt
59-
- name: Upload release asset
52+
- name: Upload release asset
6053
uses: softprops/action-gh-release@v1
6154
with:
62-
files: python-miio-git.tar.gz # 将 python-miio-git.tar.gz 文件上传到 GitHub Releases
55+
files: python-miio-git.tar.gz
6356
env:
64-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用 GITHUB_TOKEN 来进行认证
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)