From 98d2790a85aea2dd10c210019b47261ea2f80038 Mon Sep 17 00:00:00 2001 From: Marvin Menzerath Date: Tue, 17 Aug 2021 20:33:42 +0200 Subject: [PATCH] feat: add darwin builds --- .github/workflows/build.yml | 68 +++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2202a18..a7d3ecd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,9 +9,6 @@ on: pull_request: branches: - main - release: - types: - - published jobs: build_linux: @@ -26,12 +23,12 @@ jobs: env: GOOS: "linux" GOARCH: "amd64" - run: go build -o build/monstercat main.go + run: go build -o build/monstercat_linux_amd64 main.go - name: store binary uses: actions/upload-artifact@v2 with: name: linux - path: build/monstercat + path: build/ build_windows: runs-on: ubuntu-latest steps: @@ -44,15 +41,51 @@ jobs: env: GOOS: "windows" GOARCH: "amd64" - run: go build -o build/monstercat.exe main.go + run: go build -o build/monstercat_windows_amd64.exe main.go - name: store binary uses: actions/upload-artifact@v2 with: name: windows - path: build/monstercat.exe + path: build/ + build_darwin_amd64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: build project + env: + GOOS: "darwin" + GOARCH: "amd64" + run: go build -o build/monstercat_darwin_amd64 main.go + - name: store binary + uses: actions/upload-artifact@v2 + with: + name: darwin_amd64 + path: build/ + build_darwin_arm64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: build project + env: + GOOS: "darwin" + GOARCH: "arm64" + run: go build -o build/monstercat_darwin_arm64 main.go + - name: store binary + uses: actions/upload-artifact@v2 + with: + name: darwin_arm64 + path: build/ release: runs-on: ubuntu-latest - needs: [build_linux, build_windows] + needs: [build_linux, build_windows, build_darwin_amd64, build_darwin_arm64] if: startsWith(github.ref, 'refs/tags/') steps: - name: download linux binary @@ -65,8 +98,21 @@ jobs: with: name: windows path: windows/ - - uses: softprops/action-gh-release@v1 + - name: download darwin amd64 binary + uses: actions/download-artifact@v2 + with: + name: darwin_amd64 + path: darwin_amd64/ + - name: download darwin arm64 binary + uses: actions/download-artifact@v2 + with: + name: darwin_arm64 + path: darwin_arm64/ + - name: upload artifacts to release + uses: softprops/action-gh-release@v1 with: files: | - linux/monstercat - windows/monstercat.exe + linux/monstercat_linux_amd64 + windows/monstercat_windows_amd64.exe + darwin_amd64/monstercat_darwin_amd64 + darwin_arm64/monstercat_darwin_arm64