Automatically build the project for Windows users

This change makes it simpler for Windows users to use the project by automatically building the project with GitHub Actions on every release.

This allows for an easier way to use the project by automatically adding a zip file with the built executables to new releases.
This commit is contained in:
NickAc 2020-05-30 21:01:54 +01:00 committed by GitHub
parent 1872bf4b4c
commit e4a2fbd51a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
name: Build WakAPI on Windows
on:
release:
types:
- created
jobs:
build-and-release:
name: Build and add to release
runs-on: windows-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Enable Go 1.11 modules
run: cmd /c "set GO111MODULE=on"
- name: Build
run: go build -v .
- name: Upload Built Executable to Github Actions Artifacts
uses: actions/upload-artifact@v2
with:
name: release.zip
# A file, directory or wildcard pattern that describes what to upload
path: ./
- name: Compress working folder
run: Compress-Archive -Path .\* -DestinationPath release.zip
- name: Upload built executable to Release
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