2020-02-27 11:16:04 +02:00
|
|
|
name: Build dlc.dat
|
2020-01-05 03:28:32 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-06-02 23:09:42 +03:00
|
|
|
paths-ignore:
|
|
|
|
- "**/README.md"
|
|
|
|
- ".github/**"
|
2020-01-05 03:28:32 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-07-12 05:59:41 +03:00
|
|
|
- name: Setup Go 1.x.y
|
2020-06-06 05:40:14 +03:00
|
|
|
uses: actions/setup-go@v2
|
2020-01-05 03:28:32 +02:00
|
|
|
with:
|
2020-07-23 09:19:49 +03:00
|
|
|
go-version: "^1.14.6"
|
2020-01-05 03:28:32 +02:00
|
|
|
|
|
|
|
- name: Set $GOPATH and more variables
|
|
|
|
run: |
|
2020-07-06 05:00:19 +03:00
|
|
|
echo "::set-env name=RELEASE_NAME::$(date +%Y%m%d%H%M%S)"
|
|
|
|
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M%S)"
|
2020-06-02 21:57:34 +03:00
|
|
|
echo "::set-env name=REPO_URL::github.com/${{ github.repository }}"
|
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: |
|
2020-06-02 21:57:34 +03:00
|
|
|
domain-list-community --datapath=${{ env.GOPATH }}/src/${{ env.REPO_URL }}/data
|
2020-01-05 03:28:32 +02:00
|
|
|
|
2020-03-12 17:00:07 +02:00
|
|
|
- name: Generate dlc.dat sha256 hash
|
|
|
|
run: |
|
|
|
|
sha256sum dlc.dat > dlc.dat.sha256sum
|
|
|
|
|
2020-03-12 17:02:56 +02:00
|
|
|
- name: Git push assets to "release" branch
|
|
|
|
run: |
|
|
|
|
git init
|
2020-07-12 05:59:41 +03:00
|
|
|
git config --local user.name "actions"
|
|
|
|
git config --local user.email "action@github.com"
|
2020-03-12 17:02:56 +02:00
|
|
|
git checkout -b release
|
|
|
|
git add dlc.dat dlc.dat.sha256sum
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
2020-03-12 17:00:07 +02:00
|
|
|
- name: Upload dlc.dat
|
2020-02-27 11:16:04 +02:00
|
|
|
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
|
2020-03-12 17:00:07 +02:00
|
|
|
|
|
|
|
- name: Upload dlc.dat sha256sum
|
|
|
|
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.sha256sum
|
|
|
|
asset_name: dlc.dat.sha256sum
|
|
|
|
asset_content_type: text/plain
|