diff --git a/.github/workflows/delete.yml b/.github/workflows/delete.yml new file mode 100644 index 00000000000..b19f07ea45d --- /dev/null +++ b/.github/workflows/delete.yml @@ -0,0 +1,16 @@ +name: Delete old workflow runs +on: + schedule: + - cron: '0 0 1 * *' +# Run monthly, at 00:00 on the 1st day of month. + +jobs: + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: GitRML/delete-workflow-runs@main + with: + token: ${{ secrets.AUTH_PAT }} + repository: ${{ github.repository }} + retain_days: 30 diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 44ec65f7175..79712a4b716 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -198,31 +198,27 @@ jobs: sed -i 's/Dreamacro\/maxmind-geoip/Loyalsoldier\/geoip/g' main.go go run -v . - - name: Move and zip files and generate sha256 hash + - name: Move and zip files run: | mkdir -p ./publish/ + wget https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb -O ./publish/country.mmdb install -Dp ./geoip.dat ./publish/ - install -Dp ./geoip.dat.sha256sum ./publish/ install -Dp ./custom/publish/geosite.dat ./publish/ install -Dp ./sing-geosite/geosite.db ./publish/ install -Dp ./sing-geosite/geosite-v2fly.db ./publish/ install -Dp ./sing-geoip/geoip.db ./publish/ - install -p {proxy,direct,reject}-tld-list.txt ./publish/ install -p {proxy,direct,reject}-list.txt ./publish/ install -p hosts ./publish/ - install -p {apple-cn,google-cn,gfw,win-spy,win-update,win-extra}.txt ./publish/ + install -p apple-cn.txt ./publish/ cd ./publish || exit 1 zip rules.zip {proxy,direct,reject}-list.txt geoip.dat geosite.dat geosite.db geosite-v2fly.db geoip.db - sha256sum geosite.dat > geosite.dat.sha256sum - sha256sum geosite.db > geosite.db.sha256sum - sha256sum geoip.db > geoip.db.sha256sum - sha256sum rules.zip > rules.zip.sha256sum + - name: Release and upload assets uses: softprops/action-gh-release@v0.1.6 with: name: ${{ env.RELEASE_NAME }} - tag_name: ${{ env.TAG_NAME }} + tag_name: latest draft: false prerelease: false files: |