You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB
YAML

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: Make directory
run: |
mkdir -p Clash/RuleSet/StreamingMedia
- 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 init
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 main