From 0a513e959be6760bd42c30643c77d81dd4e4a557 Mon Sep 17 00:00:00 2001 From: NickAc <32451103+NickAcPT@users.noreply.github.com> Date: Sat, 30 May 2020 21:50:16 +0100 Subject: [PATCH] Automatically build the project for Linux users Add a GitHub Action to build on Linux when a release is created --- .github/workflows/linux-build-on-release.yml | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/linux-build-on-release.yml diff --git a/.github/workflows/linux-build-on-release.yml b/.github/workflows/linux-build-on-release.yml new file mode 100644 index 0000000..f762644 --- /dev/null +++ b/.github/workflows/linux-build-on-release.yml @@ -0,0 +1,43 @@ +name: Build WakAPI on Linux + +on: + release: + types: + - created + +jobs: + build-and-release: + name: Build and add to Release + runs-on: ubuntu-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: Build + run: GO111MODULE=on go build -v . + + - name: Zip Release + uses: TheDoctor0/zip-release@v0.3.0 + with: + filename: 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_linux.zip + asset_content_type: application/gzip