mirror of
https://github.com/MetaCubeX/meta-rules-dat.git
synced 2024-11-10 03:55:35 +08:00
Rename lists names & upload release assets manually
This commit is contained in:
parent
7d958f8de9
commit
eb2b40341f
53
.github/workflows/build.yml
vendored
53
.github/workflows/build.yml
vendored
@ -5,22 +5,19 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Go 1.14
|
- name: Setup Go 1.14
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.14
|
go-version: 1.14
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Set $GOPATH and more variables
|
- name: Set $GOPATH and more variables
|
||||||
run: |
|
run: |
|
||||||
echo "::set-env name=NAME::Released on $(date +%Y%m%d%H%M)"
|
echo "::set-env name=RELEASE_NAME::Released on $(date +%Y%m%d%H%M)"
|
||||||
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
|
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
|
||||||
echo "::set-env name=GEOIP_REPO::github.com/v2ray/geoip"
|
echo "::set-env name=GEOIP_REPO::github.com/v2ray/geoip"
|
||||||
echo "::set-env name=GEOSITE_REPO::github.com/v2ray/domain-list-community"
|
echo "::set-env name=GEOSITE_REPO::github.com/v2ray/domain-list-community"
|
||||||
@ -94,26 +91,26 @@ jobs:
|
|||||||
|
|
||||||
- name: Sort and generate lists
|
- name: Sort and generate lists
|
||||||
run: |
|
run: |
|
||||||
cat temp-proxy.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/proxylist
|
cat temp-proxy.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/proxy-list
|
||||||
cat temp-proxy.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > proxy-excluse-list.txt
|
cat temp-proxy.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > proxy-excluse-list
|
||||||
cat temp-direct.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/directlist
|
cat temp-direct.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/direct-list
|
||||||
cat temp-direct.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > direct-excluse-list.txt
|
cat temp-direct.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > direct-excluse-list
|
||||||
cat temp-reject.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/rejectlist
|
cat temp-reject.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/reject-list
|
||||||
cat temp-reject.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > reject-excluse-list.txt
|
cat temp-reject.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > reject-excluse-list
|
||||||
|
|
||||||
- name: Add list into appropriate category file
|
- name: Add list into appropriate category file
|
||||||
run: |
|
run: |
|
||||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||||
echo "include:proxylist" >> geolocation-\!cn
|
echo "include:proxy-list" >> geolocation-\!cn
|
||||||
echo "include:directlist" >> cn
|
echo "include:direct-list" >> cn
|
||||||
echo "include:rejectlist" >> category-ads-all
|
echo "include:reject-list" >> category-ads-all
|
||||||
|
|
||||||
- name: Build geosite.dat file
|
- name: Build geosite.dat file
|
||||||
run: |
|
run: |
|
||||||
domain-list-community
|
domain-list-community
|
||||||
mv ./dlc.dat ./publish/geosite.dat
|
mv ./dlc.dat ./publish/geosite.dat
|
||||||
mv ./*-excluse-list.txt ./publish/
|
mv ./*-excluse-list ./publish/
|
||||||
cp -f $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}list ./publish/
|
cp -f $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}-list ./publish/
|
||||||
|
|
||||||
- name: Generate dat files sha256 hash
|
- name: Generate dat files sha256 hash
|
||||||
run: |
|
run: |
|
||||||
@ -121,8 +118,28 @@ jobs:
|
|||||||
sha256sum geoip.dat > geoip.dat.sha256
|
sha256sum geoip.dat > geoip.dat.sha256
|
||||||
sha256sum geosite.dat > geosite.dat.sha256
|
sha256sum geosite.dat > geosite.dat.sha256
|
||||||
|
|
||||||
- name: Release dat files
|
- name: Create a release
|
||||||
uses: Ricky-Hao/action-release@master
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
ASSET_PATH: publish
|
with:
|
||||||
|
tag_name: ${{ env.TAG_NAME }}
|
||||||
|
release_name: ${{ env.RELEASE_NAME }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Upload assets
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
release_id: ${{ steps.create_release.outputs.id }}
|
||||||
|
run: |
|
||||||
|
files=$(ls ./publish)
|
||||||
|
for ASSET in ${files}; do
|
||||||
|
FILEPATH="./publish/${ASSET}"
|
||||||
|
FILETYPE=$(file -b --mime-type "${FILEPATH}")
|
||||||
|
CONTENT_TYPE_HEADER="Content-Type: ${FILETYPE}"
|
||||||
|
AUTH_HEADER="Authorization: token ${{ env.GITHUB_TOKEN }}"
|
||||||
|
URL="https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.release_id }}/assets?name=${ASSET}"
|
||||||
|
curl -sSL -X POST -H "${AUTH_HEADER}" -H "${CONTENT_TYPE_HEADER}" --data-binary @${FILEPATH} ${URL}
|
||||||
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user