Generate RULE-SET for Clash

automation
MOOn 2 years ago
parent 7b06f1f5bc
commit a124c2afb2

@ -0,0 +1,36 @@
name: Generate RULE-SET for Premium Edition of Clash
on:
workflow_dispatch:
schedule:
- cron: "30 22 * * *"
push:
branches:
- automation
paths-ignore:
- "**/README.md"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: https://github.com/actions/checkout@v3
- name: Set variables
run: |
echo "RELEASE_NAME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
echo "streaming=https://git.moon.re/MOOn/Profiles/raw/branch/automation/streaming.txt" >> $GITHUB_ENV
shell: bash
- name: Generate streaming.yaml file
run: |
echo "payload:" > Clash/RuleSet/StreamingMedia/streaming.yaml
curl -sSL ${streaming} | awk -F ':' '/^full:/ {printf " - |%s|\n", $2}' | sed "s/|/'/g" >> Clash/RuleSet/StreamingMedia/streaming.yaml
curl -sSL ${streaming} | awk -F ':' '/^domain:/ {printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> Clash/RuleSet/StreamingMedia/streaming.yaml
- name: Git push
run: |
git config --local user.name "gitea-actions[bot]"
git config --local user.email "gitea-actions[bot]@moon.re"
git add Clash
git commit -m "${{ env.RELEASE_NAME }}"
git push origin automation:main
Loading…
Cancel
Save