Build rules dat files #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build rules dat files | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 22 * * *" # 6:30 AM UTC+8 | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: boluomimohesa/sing-rules-dat | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Convert bm7-rule-set to sing-rule-set | |
run: | | |
mkdir -p ./sing-rule/bm7 | |
cp ./resouces/bm7.sh ./sing-rule/bm7/ | |
cd ./sing-rule/bm7 | |
wget https://github.com/SagerNet/sing-box/releases/download/v1.8.0-alpha.1/sing-box-1.8.0-alpha.1-linux-amd64.tar.gz -O sing-box.tar.gz && tar zxvf sing-box.tar.gz && mv sing-box-1.8.0-alpha.1-linux-amd64/sing-box ./ && rm -r sing-box-1.8.0-alpha.1-linux-amd64 | |
ls | |
chmod 755 bm7.sh && ./bm7.sh | |
rm -r bm7.sh sing-box* rule | |
- name: Git push assets to "sing-rule" branch | |
run: | | |
cd sing-rule || exit 1 | |
ls | |
git init | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git checkout -b sing | |
git add . | |
git commit -m "Released on ${{ env.BUILDTIME }}" | |
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f -u origin sing | |