Initial commit
This commit is contained in:
		
							
								
								
									
										67
									
								
								.gitea/workflows/build.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								.gitea/workflows/build.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
			
		||||
name: Build geosite.dat
 | 
			
		||||
on:
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
  schedule:
 | 
			
		||||
    - cron: "30 21 * * *"
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - master
 | 
			
		||||
    paths-ignore:
 | 
			
		||||
      - "**/README.md"
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      # - name: Compare latest tags and set variables
 | 
			
		||||
      #   run: |
 | 
			
		||||
      #     upstreamLatestTag=$(curl -sSL --connect-timeout 5 --retry 5 -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/v2fly/domain-list-community/releases/latest | grep "tag_name" | cut -d\" -f4)
 | 
			
		||||
      #     thisLatestTag=$(curl -sSL --connect-timeout 5 --retry 5 -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/releases/latest | grep "tag_name" | cut -d\" -f4)
 | 
			
		||||
      #     if [[ $upstreamLatestTag != $thisLatestTag ]]; then
 | 
			
		||||
      #       echo "NeedToSync=true" >> $GITHUB_ENV
 | 
			
		||||
      #     fi
 | 
			
		||||
      #     echo "RELEASE_NAME=$upstreamLatestTag" >> $GITHUB_ENV
 | 
			
		||||
      #     echo "TAG_NAME=$upstreamLatestTag" >> $GITHUB_ENV
 | 
			
		||||
      #   shell: bash
 | 
			
		||||
 | 
			
		||||
      - name: Checkout codebase
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
        # if: ${{ env.NeedToSync }}
 | 
			
		||||
 | 
			
		||||
      - name: Setup Go
 | 
			
		||||
        uses: actions/setup-go@v4
 | 
			
		||||
        # if: ${{ env.NeedToSync }}
 | 
			
		||||
        with:
 | 
			
		||||
          go-version-file: ./go.mod
 | 
			
		||||
 | 
			
		||||
      - name: Set variables
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "RELEASE_NAME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
 | 
			
		||||
          echo "TAG_NAME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
 | 
			
		||||
        shell: bash
 | 
			
		||||
 | 
			
		||||
      - name: Checkout v2fly/domain-list-community
 | 
			
		||||
        # if: ${{ env.NeedToSync }}
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
        with:
 | 
			
		||||
          repository: https://github.com/v2fly/domain-list-community
 | 
			
		||||
          path: domain-list-community
 | 
			
		||||
 | 
			
		||||
      - name: Append attribute rules
 | 
			
		||||
        # if: ${{ env.NeedToSync }}
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "include:netflix" >> ./domain-list-community/data/streaming
 | 
			
		||||
 | 
			
		||||
      - name: Get dependencies and run
 | 
			
		||||
        # if: ${{ env.NeedToSync }}
 | 
			
		||||
        run: |
 | 
			
		||||
          go run ./ --datapath=./domain-list-community/data --exportlists=streaming
 | 
			
		||||
 | 
			
		||||
      - name: Git push assets to "release" branch
 | 
			
		||||
        # if: ${{ env.NeedToSync }}
 | 
			
		||||
        run: |
 | 
			
		||||
          git init
 | 
			
		||||
          git config --local user.name "gitea-actions[bot]"
 | 
			
		||||
          git config --local user.email "gitea-actions[bot]@moon.re"
 | 
			
		||||
          git add *.txt
 | 
			
		||||
          git commit -m "${{ env.RELEASE_NAME }}"
 | 
			
		||||
          git push
 | 
			
		||||
		Reference in New Issue
	
	Block a user