Skip to content

Hide personal rules in homepage. #443

Hide personal rules in homepage.

Hide personal rules in homepage. #443

Workflow file for this run

name: Generate
on:
push:
branches:
- main
paths-ignore:
- '**.md'
schedule:
- cron: '0 12 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Setup environment
run: pip install -r requirements.txt
- name: Set up Go
uses: actions/setup-go@v4
- name: Pull v2fly community domain list
uses: actions/checkout@v3
with:
repository: 'v2fly/domain-list-community'
path: 'domain-list-community'
- name: Pull Loyalsoldier's geosite tool
uses: actions/checkout@v3
with:
repository: 'Loyalsoldier/domain-list-custom'
path: 'tool_geosite'
- name: Install Loyalsoldier's geoip tool
run: go install -v github.com/Loyalsoldier/geoip@latest
- name: Pull sing-geoip tool
uses: actions/checkout@v3
with:
repository: 'xkww3n/sing-geoip'
path: 'tool_sing-geoip'
- name: Pull sing-geosite tool
uses: actions/checkout@v3
with:
repository: 'xkww3n/sing-geosite'
path: 'tool_sing-geosite'
- name: Generate rules
run: python generate.py
- name: Generate Geosite DB
run: |
cd tool_geosite
go run ./ --datapath=../dists/geosite --outputpath=../dists --exportlists="" --togfwlist=""
- name: Generate GeoIP DB
run: |
cat <<EOF > config.json
{
"input": [
{
"type": "text",
"action": "add",
"args": {
"name": "cn",
"uri": "./dists/text/domestic_ip.txt",
"onlyIPType": "ipv4"
}
},
{
"type": "text",
"action": "add",
"args": {
"name": "cn",
"uri": "./dists/text/domestic_ip6.txt",
"onlyIPType": "ipv6"
}
},
{
"type": "clashRuleSetClassical",
"action": "add",
"args": {
"name": "apns",
"uri": "./dists/yaml/apns.yaml"
}
}
],
"output": [
{
"type": "v2rayGeoIPDat",
"action": "output",
"args": {
"outputName": "geoip.dat",
"outputDir": "./dists"
}
},
{
"type": "maxmindMMDB",
"action": "output",
"args": {
"outputName": "geoip.mmdb",
"outputDir": "./dists"
}
}
]
}
EOF
geoip -c config.json
- name: Generate sing-box Geosite DB
run: |
cp dists/geosite.dat tool_sing-geosite/
cd tool_sing-geosite
go run .
cp geosite.db ../dists/
- name: Generate sing-box GeoIP DB
run: |
cp dists/geoip.mmdb tool_sing-geoip/
cd tool_sing-geoip
go run .
cp geoip.db ../dists/
- name: Remove tmp files
run: |
rm -rf dists/geosite
rm dists/gfwlist.txt
- name: Generate home page
run: python generate_homepage.py
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2e54d1245681bc04eaa33ed5d68bdfa7
projectName: xkww3n-rules
directory: ./dists
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'