Files
auto-update/.gitea/workflows/7zip_update.yml
adminroot 67c96351ec
Some checks failed
7zip_update / update-rules (push) Failing after 17s
zellij_update / update-rules (push) Successful in 17s
更新 .gitea/workflows/7zip_update.yml
2025-10-23 09:17:45 -07:00

52 lines
1.5 KiB
YAML

name: 7zip_update
on:
schedule:
- cron: '0 23 * * *' # 每天北京时间早上7点执行
workflow_dispatch: # 允许手动触发
push:
branches: [ main, master ]
env:
7Z_VERSION: "2501"
jobs:
update-rules:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: 创建目录结构
run: |
mkdir -p app/ tmp/
- name: 下载并解压7zip
run: |
curl -L "https://www.7-zip.org/a/7z$7Z_VERSION-x86.exe" \
-o "app/7z.exe" \
--fail --silent --show-error
curl -L "https://www.7-zip.org/a/7z$7Z_VERSION-linux-x64.tar.xz" \
-o "7z.tar.xz" \
--fail --silent --show-error \
&& tar -xvf 7z.tar.xz -C tmp/ \
&& mv tmp/7zz app/ \
&& rm tmp/*
curl -L "https://www.7-zip.org/a/7z$7Z_VERSION-linux-arm64.tar.xz" \
-o "7z.tar.xz" \
--fail --silent --show-error \
&& tar -xvf 7z.tar.xz -C tmp/ \
&& mv tmp/7zz app/7zz_arm64 \
&& rm tmp/*
- name: 提交更改
run: |
git config --local user.email "gitea-actions[bot]@users.noreply.nvme.cc"
git config --local user.name "gitea-actions[bot]"
git add ./app/
git diff --cached --quiet || git commit -m "Update rules: $(TZ=Asia/Shanghai date +'%Y-%m-%d %H:%M:%S')"
git push