添加 .github/workflows/openwrt_helloworld.yml

Signed-off-by: zhao <zj18139624826@gmail.com>
This commit is contained in:
2026-01-19 15:28:16 +08:00
commit 4c0884f157

View File

@@ -0,0 +1,64 @@
name: small
on:
schedule:
- cron: 0 */4 * * *
repository_dispatch:
workflow_dispatch:
jobs:
job_openwrt_helloworld:
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id
runs-on: ubuntu-latest
name: Update openwrt_helloworld
strategy:
fail-fast: false
matrix:
target: [openwrt-25.12]
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Initialization environment
run : |
git config --global user.email "2519840456@qq.com"
git config --global user.name "Xiaokailnol"
- name: Clone packages
run: |
cd $GITHUB_WORKSPACE
chmod +x .github/diy/openwrt_helloworld.sh
git clone -b openwrt-25.12 https://gitea.kejizero.xyz/zhao/openwrt_helloworld.git ${{matrix.target}}
cd ${{matrix.target}}
git rm -r --cache * >/dev/null 2>&1 &
rm -rf `find ./* -maxdepth 0 -type d ! -name "commit"` >/dev/null 2>&1
$GITHUB_WORKSPACE/.github/diy/openwrt_helloworld.sh
bash /$GITHUB_WORKSPACE/.github/diy/convert_translation.sh
bash /$GITHUB_WORKSPACE/.github/diy/create_acl_for_luci.sh -a
bash /$GITHUB_WORKSPACE/.github/diy/Modify.sh
- name: Upload
env:
GIT_PASSWORD: ${{ secrets.git_password }}
run: |
cd $GITHUB_WORKSPACE/${{matrix.target}}
if git status --porcelain | grep .; then
Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
git add .
git commit -am "${Emoji[$[$RANDOM % ${#Emoji[@]}]]} Sync $(date +%Y-%m-%d" "%H:%M:%S)"
git push --quiet "https://zhao:${GIT_PASSWORD}@gitea.kejizero.xyz/zhao/openwrt_helloworld.git" HEAD:openwrt-25.12
else
echo "nothing to commit"
exit 0
fi || exit 0
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
continue-on-error: true
with:
retain_days: 1
keep_minimum_runs: 1