Files
HD-Icons/.github/workflows/build.yml
T

56 lines
1.3 KiB
YAML

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