v2fly-domain-list-community/.github/workflows/build.yml

59 lines
1.6 KiB
YAML
Raw Normal View History

name: Build dlc.dat
2020-01-05 03:28:32 +02:00
on:
schedule:
2020-02-01 03:12:48 +02:00
- cron: "0 0 * * 3"
2020-01-05 03:28:32 +02:00
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
2020-02-26 16:08:47 +02:00
- name: Setup Go 1.14
2020-01-05 03:28:32 +02:00
uses: actions/setup-go@v1
with:
2020-02-26 16:08:47 +02:00
go-version: 1.14
2020-01-05 03:28:32 +02:00
- name: Set $GOPATH and more variables
run: |
echo "::set-env name=RELEASE_NAME::$(date +%Y%m%d%H%M)"
2020-01-05 03:28:32 +02:00
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
2020-01-25 12:32:05 +02:00
echo "::set-env name=REPO_URL::github.com/v2ray/domain-list-community"
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
2020-01-05 03:28:32 +02:00
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: Go get project code
2020-01-05 03:28:32 +02:00
run: |
2020-01-25 12:32:05 +02:00
go get -u -v -insecure $REPO_URL
2020-01-05 03:28:32 +02:00
- name: Build dlc.dat file
2020-01-05 03:28:32 +02:00
run: |
domain-list-community
mkdir -p ./publish
mv ./dlc.dat ./publish/dlc.dat
2020-01-05 03:28:32 +02:00
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.RELEASE_NAME }}
draft: false
prerelease: false
- name: Upload dat file
id: upload-release-asset
uses: actions/upload-release-asset@v1
2020-01-05 03:28:32 +02:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./publish/dlc.dat
asset_name: dlc.dat
asset_content_type: application/octet-stream