add plannotator to category-ai-!cn (#3505) #2723
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build dlc.dat | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "**/README.md" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout codebase | |
| uses: actions/checkout@v6 | |
| with: | |
| path: code | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: code/go.mod | |
| cache-dependency-path: code/go.sum | |
| - 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: Build dlc.dat and plain lists | |
| run: | | |
| cd code || exit 1 | |
| go run ./ --outputdir=../ --exportlists=category-ads-all,tld-cn,cn,tld-\!cn,geolocation-\!cn,apple,icloud | |
| go run ./cmd/datdump/main.go --inputdata=../dlc.dat --outputdir=../ --exportlists=_all_ | |
| cd ../ && rm -rf code | |
| - name: Generate dlc.dat sha256 hash | |
| run: | | |
| sha256sum dlc.dat > dlc.dat.sha256sum | |
| sha256sum dlc.dat_plain.yml > dlc.dat_plain.yml.sha256sum | |
| - name: Generate Zip | |
| run: | | |
| zip -9 dlc.dat.zip dlc.dat | |
| sha256sum dlc.dat.zip > dlc.dat.zip.sha256sum | |
| - name: Generate XZ | |
| run: | | |
| xz -z -9 -k dlc.dat | |
| sha256sum dlc.dat.xz > dlc.dat.xz.sha256sum | |
| - name: Git push assets to "release" branch | |
| run: | | |
| 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 *.txt *.sha256sum dlc.dat dlc.dat_plain.yml dlc.dat.zip dlc.dat.xz | |
| 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: Release and upload assets | |
| run: | | |
| gh release create ${{ env.TAG_NAME }} --generate-notes --latest --title ${{ env.RELEASE_NAME }} ./dlc.dat ./dlc.dat.* ./dlc.dat_plain.yml ./dlc.dat_plain.yml.* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |