Build filterlists #1064
This file contains 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 filterlists | |
on: | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: "0 15 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.15 | |
- name: Download repo | |
uses: actions/checkout@v3 | |
- name: Download dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Runnning build/generation script | |
shell: bash | |
run: | | |
bash ./generate.sh 2>&1 | |
- name: Generate tag name | |
run: echo "TAG_NAME=$(date +%F-%H-%M)" >> $GITHUB_ENV | |
- name: Release filter lists | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/*.dat | |
name: Automatic list generation | |
tag_name: ${{ env.TAG_NAME }} | |
body_path: release.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Delete older releases | |
uses: dev-drprasad/delete-older-releases@v0.2.1 | |
with: | |
keep_latest: 2 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload log files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Logs | |
path: logs/*.log | |
if: ${{ always() }} |