This commit is contained in:
kenzok8 2022-04-09 22:48:36 +08:00
parent f5a3764bdb
commit 1d2968d3d4
2 changed files with 102 additions and 0 deletions

63
.github/workflows/sync-small.yml vendored Normal file
View File

@ -0,0 +1,63 @@
name: Update small
on:
push:
paths:
- '.github/workflows/sync-small.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 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
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/small.git" HEAD:${{matrix.target}}
- name: Delete workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 0

39
small.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
git rm -r --cache * >/dev/null 2>&1 &
function git_clone() {
git clone --depth 1 $1 $2 || true
}
function git_sparse_clone() {
branch="$1" rurl="$2" localdir="$3" && shift 3
git clone -b $branch --depth 1 --filter=blob:none --sparse $rurl $localdir
cd $localdir
git sparse-checkout init --cone
git sparse-checkout set $@
mv -n $@ ../
cd ..
rm -rf $localdir
}
git clone --depth 1 -b packages https://github.com/xiaorouji/openwrt-passwall && mv -n openwrt-passwall/chinadns-ng openwrt-passwall/dns2socks openwrt-passwall/hysteria openwrt-passwall/ipt2socks openwrt-passwall/pdnsd-alt openwrt-passwall/trojan-go openwrt-passwall/trojan-plus ./ ; rm -rf openwrt-passwall
svn co https://github.com/kenzok8/jell/trunk/brook
svn co https://github.com/openwrt/packages/trunk/net/shadowsocks-libev
svn co https://github.com/fw876/helloworld/trunk/simple-obfs
svn co https://github.com/fw876/helloworld/trunk/shadowsocks-rust
svn co https://github.com/fw876/helloworld/trunk/shadowsocksr-libev
svn co https://github.com/fw876/helloworld/trunk/ssocks
svn co https://github.com/fw876/helloworld/trunk/trojan
svn co https://github.com/fw876/helloworld/trunk/v2ray-core
svn co https://github.com/fw876/helloworld/trunk/v2ray-geodata
svn co https://github.com/fw876/helloworld/trunk/v2ray-plugin
svn co https://github.com/fw876/helloworld/trunk/v2raya
svn co https://github.com/fw876/helloworld/trunk/xray-core
svn co https://github.com/fw876/helloworld/trunk/xray-plugin
bash diy/create_acl_for_luci.sh -a >/dev/null 2>&1
bash diy/convert_translation.sh -a >/dev/null 2>&1
rm -rf ./*/.git & rm -f ./*/.gitattributes
rm -rf ./*/.svn & rm -rf ./*/.github & rm -rf ./*/.gitignore
exit 0