2020-05-31 11:29:15 +03:00
|
|
|
name: Build Wakapi on Linux
|
|
|
|
|
|
|
|
on:
|
2021-01-24 13:42:12 +03:00
|
|
|
push:
|
2021-02-03 11:41:11 +03:00
|
|
|
branches:
|
2021-01-24 13:42:12 +03:00
|
|
|
pull_request:
|
2020-05-31 11:29:15 +03:00
|
|
|
release:
|
2021-01-24 13:42:12 +03:00
|
|
|
types:
|
2021-02-03 11:41:11 +03:00
|
|
|
- published
|
2020-05-31 11:29:15 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-release:
|
2021-01-24 13:42:12 +03:00
|
|
|
name: Build
|
2020-05-31 11:29:15 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Set up Go 1.x
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-04-13 11:34:35 +03:00
|
|
|
go-version: ^1.16
|
2020-05-31 11:29:15 +03:00
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Get dependencies
|
|
|
|
run: |
|
2021-01-24 13:42:12 +03:00
|
|
|
go get
|
|
|
|
|
2020-05-31 11:29:15 +03:00
|
|
|
- name: Build
|
|
|
|
run: GO111MODULE=on go build -v .
|
|
|
|
|
2021-01-24 13:42:12 +03:00
|
|
|
- name: Zip executable and sample config
|
|
|
|
if: github.event_name == 'release'
|
|
|
|
run: |
|
|
|
|
cp config.default.yml config.yml
|
|
|
|
zip -9 release.zip wakapi config.yml
|
2020-05-31 11:29:15 +03:00
|
|
|
|
|
|
|
- name: Upload built executable to Release
|
2021-01-24 13:42:12 +03:00
|
|
|
if: github.event_name == 'release'
|
2020-05-31 11:29:15 +03:00
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
|
|
asset_path: release.zip
|
|
|
|
asset_name: wakapi_linux_amd64.zip
|
|
|
|
asset_content_type: application/gzip
|