1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
wakapi/.github/workflows/win-build-on-release.yml

52 lines
1.2 KiB
YAML
Raw Normal View History

2021-09-17 14:21:09 +03:00
name: Windows
2020-05-31 11:29:15 +03:00
on:
push:
branches:
pull_request:
2020-05-31 11:29:15 +03:00
release:
types:
- published
2020-05-31 11:29:15 +03:00
jobs:
build-and-release:
2021-09-17 14:21:09 +03:00
name: Windows - Build & Release
2020-05-31 11:29:15 +03:00
runs-on: windows-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
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: |
go get
2020-05-31 11:29:15 +03:00
- name: Enable Go 1.11 modules
run: cmd /c "set GO111MODULE=on"
2020-05-31 11:29:15 +03:00
- name: Build
run: go build -v .
2020-05-31 11:29:15 +03:00
- name: Compress working folder
if: github.event_name == 'release'
run: |
cp .\config.default.yml .\config.yml
Compress-Archive -Path .\wakapi.exe, .\config.yml -DestinationPath release.zip
2020-05-31 11:29:15 +03:00
- name: Upload built executable to Release
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_win_amd64.zip
asset_content_type: application/gzip