-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (54 loc) · 1.56 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build geosite.dat
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
push:
branches:
- master
paths-ignore:
- "**/README.md"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Set variables
run: |
echo "RELEASE_NAME=$(date +%Y-%m-%d)" >> $GITHUB_ENV
echo "TAG_NAME=$(date +%Y-%m-%d)" >> $GITHUB_ENV
shell: bash
- name: Download list
run: mkdir data && curl -o data/antifilter-community https://community.antifilter.download/list/domains.lst
- name: Build dat file
run: |
go run ./ --exportlists=antifilter-community --outputname=geosite.dat
- name: List output directory
run: |
ls -R ./
- name: Generate sha256 hash
run: |
sha256sum geosite.dat > geosite.dat.sha256sum
- name: List directory before move
run: |
ls -R ./
- name: Move files to publish directory
run: |
mkdir -p publish
mv ./*.dat ./*.sha256sum ./publish
- name: List publish directory
run: |
ls -R ./publish
- name: Release and upload assets
run: |
gh release create ${{ env.TAG_NAME }} -t ${{ env.RELEASE_NAME }} \
./publish/*.dat \
./publish/*.dat.sha256sum
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}