From e5314b4de0f1802aa0bddd1d436703100254aed0 Mon Sep 17 00:00:00 2001 From: adminroot Date: Thu, 23 Oct 2025 09:12:53 -0700 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20.gitea/workflows/7zip=5Fup?= =?UTF-8?q?date.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/7zip_update.yml | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/7zip_update.yml diff --git a/.gitea/workflows/7zip_update.yml b/.gitea/workflows/7zip_update.yml new file mode 100644 index 0000000..0d6cba5 --- /dev/null +++ b/.gitea/workflows/7zip_update.yml @@ -0,0 +1,42 @@ +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://github.com/ip7z/7zip/releases/download/latest/7z$7Z_VERSION.exe" \ + -o "app/7z.exe" \ + --fail --silent --show-error + + curl -L "https://github.com/ip7z/7zip/releases/download/latest/7z$7Z_VERSION-linux-x86.tar.xz" \ + -o "7z.tar.xz" \ + --fail --silent --show-error \ + && tar -xvf 7z.tar.xz -C tmp/ \ + && mv tmp/7zz app/ + + - 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 \ No newline at end of file