2020-02-27 11:16:04 +02:00
|
|
|
name: Build dlc.dat
|
2020-01-05 03:28:32 +02:00
|
|
|
on:
|
2020-01-25 15:48:11 +02:00
|
|
|
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: |
|
2020-02-27 11:16:04 +02:00
|
|
|
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"
|
2020-02-27 11:16:04 +02:00
|
|
|
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
|
|
|
|
|
2020-02-27 11:16:04 +02:00
|
|
|
- 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
|
|
|
|
2020-02-27 11:16:04 +02:00
|
|
|
- name: Build dlc.dat file
|
2020-01-05 03:28:32 +02:00
|
|
|
run: |
|
|
|
|
domain-list-community
|
|
|
|
|
2020-02-27 11:16:04 +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 }}
|
2020-02-27 11:16:04 +02:00
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-02-27 12:47:38 +02:00
|
|
|
asset_path: ./dlc.dat
|
2020-02-27 11:16:04 +02:00
|
|
|
asset_name: dlc.dat
|
|
|
|
asset_content_type: application/octet-stream
|