mirror of
https://github.com/v2fly/domain-list-community.git
synced 2024-11-17 09:34:51 +02:00
Merge pull request #234 from Loyalsoldier/master
Use official github release action & refine workflow
This commit is contained in:
commit
d1c004599f
36
.github/workflows/build.yml
vendored
36
.github/workflows/build.yml
vendored
@ -1,11 +1,10 @@
|
||||
name: Build geosite.dat
|
||||
name: Build dlc.dat
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 3"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
@ -16,29 +15,42 @@ jobs:
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.14
|
||||
id: go
|
||||
|
||||
- name: Set $GOPATH and more variables
|
||||
run: |
|
||||
echo "::set-env name=NAME::$(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=RELEASE_NAME::$(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
|
||||
echo "::set-env name=REPO_URL::github.com/v2ray/domain-list-community"
|
||||
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
|
||||
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
|
||||
shell: bash
|
||||
|
||||
- name: Get geosite code
|
||||
- name: Go get project code
|
||||
run: |
|
||||
go get -u -v -insecure $REPO_URL
|
||||
|
||||
- name: Build geosite.dat file
|
||||
- name: Build dlc.dat file
|
||||
run: |
|
||||
domain-list-community
|
||||
mkdir -p ./publish
|
||||
mv ./dlc.dat ./publish/dlc.dat
|
||||
|
||||
- name: Release file
|
||||
uses: opspresso/action-release@master
|
||||
- name: Create a release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ASSET_PATH: publish
|
||||
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
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./dlc.dat
|
||||
asset_name: dlc.dat
|
||||
asset_content_type: application/octet-stream
|
||||
|
Loading…
Reference in New Issue
Block a user