This commit is contained in:
kenzok8 2022-04-09 23:28:54 +08:00
parent 2e5c0daea4
commit 8c4c4edde9
3 changed files with 64 additions and 69 deletions

View File

@ -1,64 +1,63 @@
name: Update openwrt-packages
on:
push:
paths:
- '.github/workflows/openwrt-packages.yml'
- 'diy/**'
schedule:
- cron: 0 */12 * * *
watch:
types: started
repository_dispatch:
jobs:
build:
runs-on: Ubuntu-20.04
name: Update ${{matrix.target}}
strategy:
fail-fast: false
matrix:
target: [master]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Initialization environment
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Clone packages
run: |
cd $GITHUB_WORKSPACE
chmod +x ${{matrix.target}}.sh
git clone -b ${{matrix.target}} https://github.com/kenzok8/openwrt-packages.git ${{matrix.target}}
cd ${{matrix.target}}
git rm -r --cache * >/dev/null 2>&1 &
$GITHUB_WORKSPACE/${{matrix.target}}.sh
$GITHUB_WORKSPACE/Modify.sh
- name: Upload
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
[ -e $GITHUB_WORKSPACE/LICENSE ] && cp $GITHUB_WORKSPACE/LICENSE $GITHUB_WORKSPACE/${{matrix.target}}
[ -e $GITHUB_WORKSPACE/README.md ] && cp $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/${{matrix.target}}
cd $GITHUB_WORKSPACE/${{matrix.target}}
git add .
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)"
git push --quiet "https://${{ secrets.ACCESS_TOKEN }}@github.com/kenzok8/openwrt-packages.git" HEAD:${{matrix.target}}
- name: Delete workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 0
name: Update openwrt-packages
on:
push:
paths:
- '.github/workflows/openwrt-packages.yml'
- 'diy/**'
schedule:
- cron: 0 */12 * * *
watch:
types: started
repository_dispatch:
jobs:
build:
runs-on: Ubuntu-20.04
name: Update ${{matrix.target}}
strategy:
fail-fast: false
matrix:
target: [master]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Initialization environment
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Clone packages
run: |
cd $GITHUB_WORKSPACE
chmod +x ${{matrix.target}}.sh
git clone -b ${{matrix.target}} https://github.com/kenzok8/openwrt-packages.git ${{matrix.target}}
cd ${{matrix.target}}
$GITHUB_WORKSPACE/${{matrix.target}}.sh
$GITHUB_WORKSPACE/Modify.sh
- name: Upload
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
[ -e $GITHUB_WORKSPACE/LICENSE ] && cp $GITHUB_WORKSPACE/LICENSE $GITHUB_WORKSPACE/${{matrix.target}}
[ -e $GITHUB_WORKSPACE/README.md ] && cp $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/${{matrix.target}}
cd $GITHUB_WORKSPACE/${{matrix.target}}
git add .
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)"
git push --quiet "https://${{ secrets.ACCESS_TOKEN }}@github.com/kenzok8/openwrt-packages.git" HEAD:${{matrix.target}}
- name: Delete workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 0

View File

@ -40,7 +40,6 @@ jobs:
chmod +x small.sh
git clone -b ${{matrix.target}} https://github.com/kenzok8/small.git ${{matrix.target}}
cd ${{matrix.target}}
git rm -r --cache * >/dev/null 2>&1 &
$GITHUB_WORKSPACE/small.sh
- name: Upload

View File

@ -66,10 +66,7 @@ svn co https://github.com/coolsnowwolf/packages/trunk/multimedia/UnblockNeteaseM
svn co https://github.com/immortalwrt/packages/trunk/net/gost
svn co https://github.com/immortalwrt/packages/trunk/utils/filebrowser
mv -n openwrt-passwall/* ./ ; rm -Rf openwrt-passwall
mv -n openwrt-package/* ./ ; rm -Rf openwrt-package
rm -rf ./*/.git & rm -f ./*/.gitattributes
rm -rf ./*/.git & rm -rf ./*/.gitattributes
rm -rf ./*/.svn & rm -rf ./*/.github & rm -rf ./*/.gitignore
exit 0