mirror of
https://github.com/xushier/HD-Icons.git
synced 2026-10-29 16:05:13 +08:00
ci: 引入自动化构建流水线(inbox 收件箱 + Actions + 新 README)
This commit is contained in:
1 parent
b15f076b84
commit
f2265cf358
14 files changed
+641
-444
No files matched your search
@@ -0,0 +1,55 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "inbox/**"
|
||||
- "scripts/**"
|
||||
- ".github/workflows/build.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: build
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出仓库
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 安装 Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: 安装依赖
|
||||
run: |
|
||||
pip install Pillow
|
||||
if ! command -v rsvg-convert >/dev/null 2>&1; then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq librsvg2-bin
|
||||
fi
|
||||
|
||||
- name: 构建
|
||||
id: build
|
||||
env:
|
||||
TINYPNG_KEY: ${{ secrets.TINYPNG_KEY }}
|
||||
run: python scripts/build.py --repo .
|
||||
|
||||
- name: 提交并推送
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add -A
|
||||
if git diff --cached --quiet; then
|
||||
echo "没有需要提交的变更"
|
||||
else
|
||||
git commit -m "ci: 自动构建(新增 ${{ steps.build.outputs.added }} 个图标)"
|
||||
git push
|
||||
fi
|
||||
Reference in new issue
Block a user