Compare commits
1 Commits
2020102922
...
2020102704
Author | SHA1 | Date | |
---|---|---|---|
|
5e7956ebe4 |
98
.github/workflows/build.yml
vendored
Normal file
98
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
name: Generate RULE-SET for Premium Edition of Clash
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 22 * * *"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths-ignore:
|
||||||
|
- "**/README.md"
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set variables
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NAME=Released on $(date +%Y%m%d%H%M)" >> $GITHUB_ENV
|
||||||
|
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
|
||||||
|
echo "v2fly_icloud=https://raw.githubusercontent.com/v2fly/domain-list-community/release/icloud.txt" >> $GITHUB_ENV
|
||||||
|
echo "v2fly_apple=https://raw.githubusercontent.com/v2fly/domain-list-community/release/apple.txt" >> $GITHUB_ENV
|
||||||
|
echo "Loyalsoldier_reject=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt" >> $GITHUB_ENV
|
||||||
|
echo "Loyalsoldier_proxy=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt" >> $GITHUB_ENV
|
||||||
|
echo "Loyalsoldier_direct=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt" >> $GITHUB_ENV
|
||||||
|
echo "felixonmars_apple=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
|
||||||
|
echo "felixonmars_google=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
|
||||||
|
echo "ipipnet_chinaiplist=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Checkout the "hidden" branch
|
||||||
|
uses: actions/checkout@v2.3.3
|
||||||
|
with:
|
||||||
|
ref: hidden
|
||||||
|
|
||||||
|
- name: Generate icloud.txt file
|
||||||
|
run: |
|
||||||
|
echo "payload:" > icloud.txt
|
||||||
|
curl -sSL ${v2fly_icloud} | grep -E "^(full|domain):" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt
|
||||||
|
|
||||||
|
- name: Generate google.txt file
|
||||||
|
run: |
|
||||||
|
echo "payload:" > google.txt
|
||||||
|
curl -sSL ${felixonmars_google} | perl -ne '/^server=\/([^\/]+)\// && print " - |+.$1|\n"' | sed "s/|/'/g" >> google.txt
|
||||||
|
|
||||||
|
- name: Generate apple.txt file
|
||||||
|
run: |
|
||||||
|
curl -sSL ${felixonmars_apple} | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > apple.temp
|
||||||
|
curl -sSL ${v2fly_apple} | grep -E "^(full|domain):" | awk -F ':' '{print $2}' >> apple.temp
|
||||||
|
echo "payload:" > apple.txt
|
||||||
|
cat apple.temp | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> apple.txt
|
||||||
|
|
||||||
|
- name: Generate direct.txt file
|
||||||
|
run: |
|
||||||
|
echo "payload:" > direct.txt
|
||||||
|
curl -sSL ${Loyalsoldier_direct} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> direct.txt
|
||||||
|
|
||||||
|
- name: Generate proxy.txt file
|
||||||
|
run: |
|
||||||
|
echo "payload:" > proxy.txt
|
||||||
|
curl -sSL ${Loyalsoldier_proxy} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> proxy.txt
|
||||||
|
|
||||||
|
- name: Generate reject.txt file
|
||||||
|
run: |
|
||||||
|
echo "payload:" > reject.txt
|
||||||
|
curl -sSL ${Loyalsoldier_reject} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> reject.txt
|
||||||
|
|
||||||
|
- name: Generate cncidr.txt file
|
||||||
|
run: |
|
||||||
|
echo "payload:" > cncidr.txt
|
||||||
|
curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print " - |$1|\n"' | sed "s/|/'/g" >> cncidr.txt
|
||||||
|
|
||||||
|
- name: Move files to publish directory
|
||||||
|
run: |
|
||||||
|
mkdir -p publish
|
||||||
|
install -p {apple,icloud,google,proxy,direct,reject,cncidr,lancidr}.txt ./publish/
|
||||||
|
|
||||||
|
- name: Release and upload assets
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NAME }}
|
||||||
|
tag_name: ${{ env.TAG_NAME }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
files: |
|
||||||
|
./publish/*
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Git push assets to "release" branch
|
||||||
|
run: |
|
||||||
|
cd publish
|
||||||
|
git init
|
||||||
|
git config --local user.name "actions"
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
git checkout -b release
|
||||||
|
git add .
|
||||||
|
git commit -m "${{ env.RELEASE_NAME }}"
|
||||||
|
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
||||||
|
git push -f -u origin release
|
116
.github/workflows/run.yml
vendored
116
.github/workflows/run.yml
vendored
@@ -1,98 +1,34 @@
|
|||||||
name: Generate RULE-SET for Premium Edition of Clash
|
# This is a basic workflow to help you get started with Actions
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||||
|
# events but only for the master branch
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
|
||||||
- cron: "30 22 * * *"
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [ master ]
|
||||||
- master
|
pull_request:
|
||||||
paths-ignore:
|
branches: [ master ]
|
||||||
- "**/README.md"
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
|
# This workflow contains a single job called "build"
|
||||||
build:
|
build:
|
||||||
|
# The type of runner that the job will run on
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
- name: Set variables
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Runs a single command using the runners shell
|
||||||
|
- name: Run a one-line script
|
||||||
|
run: echo Hello, world!
|
||||||
|
|
||||||
|
# Runs a set of commands using the runners shell
|
||||||
|
- name: Run a multi-line script
|
||||||
run: |
|
run: |
|
||||||
echo "RELEASE_NAME=Released on $(date +%Y%m%d%H%M)" >> $GITHUB_ENV
|
echo Add other actions to build,
|
||||||
echo "TAG_NAME=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
|
echo test, and deploy your project.
|
||||||
echo "v2fly_icloud=https://raw.githubusercontent.com/v2fly/domain-list-community/release/icloud.txt" >> $GITHUB_ENV
|
|
||||||
echo "v2fly_apple=https://raw.githubusercontent.com/v2fly/domain-list-community/release/apple.txt" >> $GITHUB_ENV
|
|
||||||
echo "Loyalsoldier_reject=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt" >> $GITHUB_ENV
|
|
||||||
echo "Loyalsoldier_proxy=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt" >> $GITHUB_ENV
|
|
||||||
echo "Loyalsoldier_direct=https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/direct-list.txt" >> $GITHUB_ENV
|
|
||||||
echo "felixonmars_apple=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
|
|
||||||
echo "felixonmars_google=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
|
|
||||||
echo "ipipnet_chinaiplist=https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Checkout the "hidden" branch
|
|
||||||
uses: actions/checkout@v2.3.3
|
|
||||||
with:
|
|
||||||
ref: hidden
|
|
||||||
|
|
||||||
- name: Generate icloud.txt file
|
|
||||||
run: |
|
|
||||||
echo "payload:" > icloud.txt
|
|
||||||
curl -sSL ${v2fly_icloud} | grep -E "^(full|domain):" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt
|
|
||||||
|
|
||||||
- name: Generate google.txt file
|
|
||||||
run: |
|
|
||||||
echo "payload:" > google.txt
|
|
||||||
curl -sSL ${felixonmars_google} | perl -ne '/^server=\/([^\/]+)\// && print " - |+.$1|\n"' | sed "s/|/'/g" >> google.txt
|
|
||||||
|
|
||||||
- name: Generate apple.txt file
|
|
||||||
run: |
|
|
||||||
curl -sSL ${felixonmars_apple} | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > apple.temp
|
|
||||||
curl -sSL ${v2fly_apple} | grep -E "^(full|domain):" | awk -F ':' '{print $2}' >> apple.temp
|
|
||||||
echo "payload:" > apple.txt
|
|
||||||
cat apple.temp | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> apple.txt
|
|
||||||
|
|
||||||
- name: Generate direct.txt file
|
|
||||||
run: |
|
|
||||||
echo "payload:" > direct.txt
|
|
||||||
curl -sSL ${Loyalsoldier_direct} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> direct.txt
|
|
||||||
|
|
||||||
- name: Generate proxy.txt file
|
|
||||||
run: |
|
|
||||||
echo "payload:" > proxy.txt
|
|
||||||
curl -sSL ${Loyalsoldier_proxy} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> proxy.txt
|
|
||||||
|
|
||||||
- name: Generate reject.txt file
|
|
||||||
run: |
|
|
||||||
echo "payload:" > reject.txt
|
|
||||||
curl -sSL ${Loyalsoldier_reject} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> reject.txt
|
|
||||||
|
|
||||||
- name: Generate cncidr.txt file
|
|
||||||
run: |
|
|
||||||
echo "payload:" > cncidr.txt
|
|
||||||
curl -sSL ${ipipnet_chinaiplist} | perl -ne '/^(\d{1,3}(\.\d{1,3}){3}\/\d{1,2})/ && print " - |$1|\n"' | sed "s/|/'/g" >> cncidr.txt
|
|
||||||
|
|
||||||
- name: Move files to publish directory
|
|
||||||
run: |
|
|
||||||
mkdir -p publish
|
|
||||||
install -p {apple,icloud,google,proxy,direct,reject,cncidr,lancidr}.txt ./publish/
|
|
||||||
|
|
||||||
- name: Release and upload assets
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
name: ${{ env.RELEASE_NAME }}
|
|
||||||
tag_name: ${{ env.TAG_NAME }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
files: |
|
|
||||||
./publish/*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Git push assets to "release" branch
|
|
||||||
run: |
|
|
||||||
cd publish
|
|
||||||
git init
|
|
||||||
git config --local user.name "actions"
|
|
||||||
git config --local user.email "action@github.com"
|
|
||||||
git checkout -b release
|
|
||||||
git add .
|
|
||||||
git commit -m "${{ env.RELEASE_NAME }}"
|
|
||||||
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
|
||||||
git push -f origin release
|
|
||||||
|
Reference in New Issue
Block a user