name: Build V2Ray rules dat files
on:
  workflow_dispatch:
  schedule:
    - cron: "0 22 * * *"
  push:
    branches:
      - master
    paths-ignore:
      - "**/README.md"
jobs:
  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 "CHINA_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf" >> $GITHUB_ENV
          echo "GOOGLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
          echo "APPLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
          echo "EASYLISTCHINA_EASYLIST_REJECT_URL=https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt" >> $GITHUB_ENV
          echo "PETERLOWE_REJECT_URL=https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" >> $GITHUB_ENV
          echo "ADGUARD_DNS_REJECT_URL=https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" >> $GITHUB_ENV
          echo "DANPOLLOCK_REJECT_URL=https://someonewhocares.org/hosts/hosts" >> $GITHUB_ENV
          echo "CUSTOM_DIRECT=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/cn.txt" >> $GITHUB_ENV
          echo "CUSTOM_PROXY=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/geolocation-!cn.txt" >> $GITHUB_ENV
          echo "WIN_SPY=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" >> $GITHUB_ENV
          echo "WIN_UPDATE=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt" >> $GITHUB_ENV
          echo "WIN_EXTRA=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt" >> $GITHUB_ENV
        shell: bash

      - name: Checkout the "hidden" branch of this repo
        uses: actions/checkout@v6
        with:
          ref: hidden

      - name: Checkout Loyalsoldier/domain-list-custom
        uses: actions/checkout@v6
        with:
          repository: Loyalsoldier/domain-list-custom
          path: custom

      - name: Checkout v2fly/domain-list-community
        uses: actions/checkout@v6
        with:
          repository: v2fly/domain-list-community
          path: community

      - name: Checkout cokebar/gfwlist2dnsmasq
        uses: actions/checkout@v6
        with:
          repository: cokebar/gfwlist2dnsmasq
          path: gfwlist2dnsmasq

      - name: Setup Go
        uses: actions/setup-go@v6
        with:
          go-version-file: ./custom/go.mod
          cache-dependency-path: ./custom/go.sum

      - name: Get geoip.dat relative files
        run: |
          wget https://github.com/Loyalsoldier/geoip/raw/release/geoip.dat
          wget https://github.com/Loyalsoldier/geoip/raw/release/geoip.dat.sha256sum

      - name: Generate GFWList domains
        run: |
          cd gfwlist2dnsmasq || exit 1
          chmod +x ./gfwlist2dnsmasq.sh
          ./gfwlist2dnsmasq.sh -l -o ./temp-gfwlist.txt

      - name: Get and add direct domains into temp-direct.txt file
        run: |
          curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > temp-direct.txt
          curl -sSL ${CUSTOM_DIRECT} | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-direct.txt

      - name: Get and add proxy domains into temp-proxy.txt file
        run: |
          cat ./gfwlist2dnsmasq/temp-gfwlist.txt | 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"' > temp-proxy.txt
          curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
          curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
          curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-proxy.txt

      - name: Get and add reject domains into temp-reject.txt file
        run: |
          curl -sSL $EASYLISTCHINA_EASYLIST_REJECT_URL | perl -ne '/^\|\|([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})\^$/ && print "$1\n"' | perl -ne 'print if not /^[0-9]{1,3}(\.[0-9]{1,3}){3}$/' > temp-reject.txt
          curl -sSL $ADGUARD_DNS_REJECT_URL | perl -ne '/^\|\|([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})\^$/ && print "$1\n"' | perl -ne 'print if not /^[0-9]{1,3}(\.[0-9]{1,3}){3}$/' >> temp-reject.txt
          curl -sSL $PETERLOWE_REJECT_URL | perl -ne '/^127\.0\.0\.1\s([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})$/ && print "$1\n"' >> temp-reject.txt
          curl -sSL $DANPOLLOCK_REJECT_URL | perl -ne '/^127\.0\.0\.1\s([-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+){1,64})/ && print "$1\n"' | sed '1d' >> temp-reject.txt

      - name: Reserve `full`, `regexp` and `keyword` type of rules from custom lists to "reserve" files
        run: |
          curl -sSL ${CUSTOM_DIRECT} | perl -ne '/^((full|regexp|keyword):[^:]+)(\n$|:@.+)/ && print "$1\n"' | sort --ignore-case -u > direct-reserve.txt
          curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^((full|regexp|keyword):[^:]+)(\n$|:@.+)/ && print "$1\n"' | sort --ignore-case -u > proxy-reserve.txt

      - name: Add proxy, direct and reject domains from "hidden" branch to appropriate temp files
        run: |
          cat proxy.txt >> temp-proxy.txt
          cat direct.txt >> temp-direct.txt
          cat reject.txt >> temp-reject.txt

      - name: Sort and generate redundant lists
        run: |
          cat temp-proxy.txt | sort --ignore-case -u > proxy-list-with-redundant
          cat temp-direct.txt | sort --ignore-case -u > direct-list-with-redundant
          cat temp-reject.txt | sort --ignore-case -u > reject-list-with-redundant

      - name: Remove redundant domains
        run: |
          chmod +x findRedundantDomain.py
          ./findRedundantDomain.py ./direct-list-with-redundant ./direct-list-deleted-unsort
          ./findRedundantDomain.py ./proxy-list-with-redundant ./proxy-list-deleted-unsort
          ./findRedundantDomain.py ./reject-list-with-redundant ./reject-list-deleted-unsort
          [ ! -f "direct-list-deleted-unsort" ] && touch direct-list-deleted-unsort
          [ ! -f "proxy-list-deleted-unsort" ] && touch proxy-list-deleted-unsort
          [ ! -f "reject-list-deleted-unsort" ] && touch reject-list-deleted-unsort
          sort ./direct-list-deleted-unsort > ./direct-list-deleted-sort
          sort ./proxy-list-deleted-unsort > ./proxy-list-deleted-sort
          sort ./reject-list-deleted-unsort > ./reject-list-deleted-sort
          diff ./direct-list-deleted-sort ./direct-list-with-redundant | awk '/^>/{print $2}' > ./direct-list-without-redundant
          diff ./proxy-list-deleted-sort ./proxy-list-with-redundant | awk '/^>/{print $2}' > ./proxy-list-without-redundant
          diff ./reject-list-deleted-sort ./reject-list-with-redundant | awk '/^>/{print $2}' > ./reject-list-without-redundant

      - name: Remove domains from "need-to-remove" lists in "hidden" branch
        run: |
          diff ./direct-need-to-remove.txt ./direct-list-without-redundant | awk '/^>/{print $2}' > temp-cn.txt
          diff ./proxy-need-to-remove.txt ./proxy-list-without-redundant | awk '/^>/{print $2}' > temp-geolocation-\!cn.txt
          diff ./reject-need-to-remove.txt ./reject-list-without-redundant | awk '/^>/{print $2}' > temp-category-ads-all.txt

      - name: Write lists to data directory
        run: |
          cat temp-cn.txt | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' > ./community/data/cn
          cat temp-cn.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-tld-list.txt
          cat temp-geolocation-\!cn.txt | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' > ./community/data/geolocation-\!cn
          cat temp-geolocation-\!cn.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-tld-list.txt
          cat temp-category-ads-all.txt | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' > ./community/data/category-ads-all
          cat temp-category-ads-all.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-tld-list.txt

      - name: Add `full`, `regexp` and `keyword` type of rules back into "cn", "geolocation-!cn" and "category-ads-all" list
        run: |
          [ -f "direct-reserve.txt" ] && cat direct-reserve.txt >> ./community/data/cn
          [ -f "direct-domain.txt" ] && cat direct-domain.txt >> ./community/data/cn
          [ -f "proxy-reserve.txt" ] && cat proxy-reserve.txt >> ./community/data/geolocation-\!cn
          [ -f "proxy-domain.txt" ] && cat proxy-domain.txt >> ./community/data/geolocation-\!cn
          [ -f "reject-reserve.txt" ] && cat reject-reserve.txt >> ./community/data/category-ads-all
          [ -f "reject-domain.txt" ] && cat reject-domain.txt >> ./community/data/category-ads-all
          [ -f "game.txt" ] && cat game.txt >> ./community/data/category-games
          [ -f "cat-porn-mod.txt" ] && cat cat-porn-mod.txt >> ./community/data/category-porn
          [ -f "private-add.txt" ] && cat private-add.txt >> ./community/data/private
          [ -f "direct-modded.txt" ] && { [ ! -f "./community/data/direct-modded" ] && touch ./community/data/direct-modded; cat direct-modded.txt >> ./community/data/direct-modded; }
          [ -f "proxy-mix.txt" ] && { [ ! -f "./community/data/proxy-mix" ] && touch ./community/data/proxy-mix; cat proxy-mix.txt >> ./community/data/proxy-mix; }
          [ -f "cn-ads-dns-no-resolve.txt" ] && { [ ! -f "./community/data/category-cn-ads" ] && touch ./community/data/category-cn-ads; cat cn-ads-dns-no-resolve.txt >> ./community/data/category-cn-ads; }
          cp ./community/data/cn direct-list.txt
          cp ./community/data/geolocation-\!cn proxy-list.txt
          cp ./community/data/category-ads-all reject-list.txt

      - name: Create `china-list`、`google-cn`、`apple-cn`、`gfw`、`greatfire` lists
        run: |
          curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > ./community/data/china-list
          curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > china-list.txt
          curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/google-cn
          curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > google-cn.txt
          curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/apple-cn
          curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > apple-cn.txt
          cat ./gfwlist2dnsmasq/temp-gfwlist.txt | 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"' >> ./community/data/gfw
          cat ./community/data/gfw | sort --ignore-case -u > gfw.txt
          cat ./community/data/greatfire | sort --ignore-case -u > greatfire.txt
          curl -sSL $WIN_SPY | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-spy
          curl -sSL $WIN_SPY | grep "0.0.0.0" | awk '{print $2}' > win-spy.txt
          curl -sSL $WIN_UPDATE | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-update
          curl -sSL $WIN_UPDATE | grep "0.0.0.0" | awk '{print $2}' > win-update.txt
          curl -sSL $WIN_EXTRA | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-extra
          curl -sSL $WIN_EXTRA | grep "0.0.0.0" | awk '{print $2}' > win-extra.txt
          # 导出额外分类供 Loon .list 转换使用
          for cat in category-httpdns-cn category-cryptocurrency category-porn \
                     proxy-mix direct-modded netease tencent staticfile nga \
                     nyaa nexon huobi dmm tiktok category-bank-cn \
                     category-games-cn private category-cn-ads category-games 'tld-!cn' category-ip-geo-detect oppo; do
            [ -f "./community/data/${cat}" ] && \
              cat "./community/data/${cat}" | sort --ignore-case -u > "${cat}.txt" || \
              echo "# empty" > "${cat}.txt"
          done
          # 单独处理 category-cn-ads，展开 include:xxx @ads 属性过滤
          > category-cn-ads.txt
          while IFS= read -r line; do
            if [[ "$line" =~ ^include:([^[:space:]]+)[[:space:]]+@ads ]]; then
              cat_name="${BASH_REMATCH[1]}"
              src="./community/data/${cat_name}"
              if [ -f "$src" ]; then
                grep '@ads' "$src" | \
                  perl -ne '
                    s/#.*//;
                    s/\s.*//;
                    next unless length;
                    if (/^full:(.+)/) { print "full:$1\n" }
                    elsif (/^([^:@]+)/) { print "$1\n" }
                  '
              else
                echo "  ⚠️  WARNING: community/data/${cat_name} not found, skipping"
              fi
            fi
          done < cn-ads-dns-no-resolve.txt | sort --ignore-case -u >> category-cn-ads.txt
          # samsung@cn 属性过滤：只取含 @cn 的条目
          grep '@cn' ./community/data/samsung 2>/dev/null | \
            perl -ne '/^(full:)?([^:@\s]+)/ && print "$1$2\n"' | \
            sort --ignore-case -u > samsung-cn.txt || echo "# empty" > samsung-cn.txt

      - name: Generate Loon rule-set .list files
        run: |
          mkdir -p ./publish
          convert_to_loon() {
            local input="$1"
            local output="$2"
            {
              echo "# $(basename $input) - Loon rule-set"
              echo "# Build: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
              echo "# Repo: https://github.com/${{ github.repository }}"
              echo ""
              while IFS= read -r line || [ -n "$line" ]; do
                [[ -z "$line" || "$line" =~ ^# ]] && continue
                [[ "$line" =~ ^regexp: || "$line" =~ ^include: ]] && continue
                line="${line%%@*}"   # 去掉 @attr 部分
                line="${line%%:@*}"
                [[ -z "$line" ]] && continue
                if [[ "$line" =~ ^full:(.+) ]]; then
                  echo "DOMAIN,${BASH_REMATCH[1]}"
                elif [[ "$line" =~ ^keyword:(.+) ]]; then
                  echo "DOMAIN-KEYWORD,${BASH_REMATCH[1]}"
                elif [[ "$line" =~ ^domain:(.+) ]]; then
                  echo "DOMAIN-SUFFIX,${BASH_REMATCH[1]}"
                else
                  echo "DOMAIN-SUFFIX,$line"
                fi
              done < "$input"
            } > "$output"
          }

          convert_to_loon direct-list.txt              ./publish/loon-cn.list
          convert_to_loon proxy-list.txt $'./publish/loon-geolocation-\x21cn.list'
          convert_to_loon 'tld-!cn.txt'  $'./publish/loon-tld-\x21cn.list'
          convert_to_loon reject-list.txt              ./publish/loon-category-ads-all.list
          convert_to_loon china-list.txt               ./publish/loon-china-list.list
          convert_to_loon apple-cn.txt                 ./publish/loon-apple-cn.list
          convert_to_loon google-cn.txt                ./publish/loon-google-cn.list
          convert_to_loon gfw.txt                      ./publish/loon-gfw.list
          convert_to_loon greatfire.txt                ./publish/loon-greatfire.list
          convert_to_loon category-httpdns-cn.txt      ./publish/loon-category-httpdns-cn.list
          convert_to_loon category-cryptocurrency.txt  ./publish/loon-category-cryptocurrency.list
          convert_to_loon category-porn.txt            ./publish/loon-category-porn.list
          convert_to_loon proxy-mix.txt                ./publish/loon-proxy-mix.list
          convert_to_loon direct-modded.txt            ./publish/loon-direct-modded.list
          convert_to_loon netease.txt                  ./publish/loon-netease.list
          convert_to_loon tencent.txt                  ./publish/loon-tencent.list
          convert_to_loon staticfile.txt               ./publish/loon-staticfile.list
          convert_to_loon nga.txt                      ./publish/loon-nga.list
          convert_to_loon nyaa.txt                     ./publish/loon-nyaa.list
          convert_to_loon nexon.txt                    ./publish/loon-nexon.list
          convert_to_loon huobi.txt                    ./publish/loon-huobi.list
          convert_to_loon dmm.txt                      ./publish/loon-dmm.list
          convert_to_loon tiktok.txt                   ./publish/loon-tiktok.list
          convert_to_loon category-bank-cn.txt         ./publish/loon-category-bank-cn.list
          convert_to_loon category-games-cn.txt        ./publish/loon-category-games-cn.list
          convert_to_loon private.txt                  ./publish/loon-private.list
          convert_to_loon samsung-cn.txt               ./publish/loon-samsung-cn.list
          convert_to_loon category-cn-ads.txt          ./publish/loon-category-cn-ads.list
          convert_to_loon game.txt                     ./publish/loon-category-games.list
          convert_to_loon category-ip-geo-detect.txt   ./publish/loon-category-ip-geo-detect.list
          convert_to_loon oppo.txt                     ./publish/loon-oppo.list

      - name: Build geosite.dat file
        run: |
          cd custom || exit 1
          go run ./ --datapath=../community/data

      - name: Build geositemod-lite.dat for iOS
        run: |
          mkdir -p community/data-lite

          # 含 ! 的文件名单独处理，避免 bash history expansion
          cp community/data/geolocation-\!cn community/data-lite/geolocation-\!cn 2>/dev/null || echo "⚠️ geolocation-!cn not found"
          cp community/data/tld-\!cn        community/data-lite/tld-\!cn         2>/dev/null || echo "⚠️ tld-!cn not found"

          # 其余分类正常循环处理（全部不含 !）
          NEEDED_CATEGORIES=(
            private cn google-cn apple-cn
            category-ads-all category-httpdns-cn category-cryptocurrency
            category-porn category-bank-cn category-games-cn
            proxy-mix direct-modded netease tencent staticfile
            nga nyaa nexon huobi dmm tiktok samsung
            gfw greatfire category-cn-ads category-games
            category-ip-geo-detect oppo
          )

          for cat in "${NEEDED_CATEGORIES[@]}"; do
            src="community/data/${cat}"
            [ -f "$src" ] && cp "$src" "community/data-lite/${cat}" || \
              echo "⚠️  WARNING: ${cat} not found, skipping"
          done

          # 自动补全 include: 依赖
          changed=1
          while [ $changed -eq 1 ]; do
            changed=0
            for f in community/data-lite/*; do
              while IFS= read -r dep; do
                if [ ! -f "community/data-lite/$dep" ] && [ -f "community/data/$dep" ]; then
                  cp "community/data/$dep" "community/data-lite/$dep"
                  echo "  → auto-include: $dep"
                  changed=1
                fi
              done < <(grep -oP '(?<=^include:)\S+' "$f" 2>/dev/null)
            done
          done

          cd custom || exit 1
          go run ./ --datapath=../community/data-lite --datname=geositemod-lite.dat

      - name: Move and zip files and generate sha256 hash
        run: |
          install -Dp ./geoip.dat ./publish/geoip.dat
          install -Dp ./geoip.dat.sha256sum ./publish/geoip.dat.sha256sum
          install -Dp ./custom/publish/geosite.dat ./publish/geosite.dat
          install -Dp ./custom/publish/geositemod-lite.dat ./publish/geositemod-lite.dat
          install -p {proxy,direct,reject}-tld-list.txt ./publish/
          install -p {proxy,direct,reject}-list.txt ./publish/
          install -p {china-list,apple-cn,google-cn,gfw,greatfire,win-spy,win-update,win-extra}.txt ./publish/
          cd ./publish || exit 1
          zip rules.zip {proxy,direct,reject}-list.txt geoip.dat geosite.dat
          sha256sum geosite.dat > geosite.dat.sha256sum
          sha256sum geositemod-lite.dat > geositemod-lite.dat.sha256sum
          sha256sum rules.zip > rules.zip.sha256sum


      - name: Release and upload assets
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          release_name: ${{ env.RELEASE_NAME }}
          tag: ${{ env.TAG_NAME }}
          file_glob: true
          file: ./publish/*

      - name: Git push assets to "release" branch
        run: |
          cd publish || exit 1
          git init
          git config --local user.name "github-actions[bot]"
          git config --local user.email "41898282+github-actions[bot]@users.noreply.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

      - name: Purge jsdelivr CDN
        run: |
          cd publish || exit 1
          for file in $(ls); do
            curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}"
          done
