From cf14f822cf7e6114b8c306f2515a92df5c3c2df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 29 Jan 2022 21:55:39 +0100 Subject: Build on windows and linux --- .github/workflows/release.yml | 103 ++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1df3513..dddf21a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,56 +7,69 @@ on: branches: [ master ] jobs: - build: name: Build - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-2022] env: GOARCH: amd64 steps: + - name: Set up Go 1.17 + uses: actions/setup-go@v2 + with: + go-version: 1.17 + id: go + + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + + - if: startsWith(matrix.os,'ubuntu') + name: Install Dependencies + run: | + sudo apt-get --allow-releaseinfo-change update + sudo apt-get install -y libglfw3-dev libfreetype6-dev + + - name: Go Build Cache + uses: actions/cache@v2 + with: + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + + - name: Go Mod Cache + uses: actions/cache@v2 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Get dependencies + run: go get -v -t -d ./... + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + + - name: Vet + run: go vet ./... + + - name: Release Build + run: go build -ldflags '-s -w -H=windowsgui' - - name: Set up Go 1.17 - uses: actions/setup-go@v2 - with: - go-version: 1.17 - id: go - - - name: Checkout - uses: actions/checkout@v2 - - - name: Get dependencies - run: go get -v -t -d ./... - - - name: Build (Windows) - run: go build -v ./... - env: - GOOS: windows - - - name: Build (Linux) - run: go build -v ./... - - - name: Test - run: go test -v ./... - - - name: Vet - run: go vet ./... - - - name: Release Build (Linux) - run: go build -ldflags '-s -w' -o bin/engarde-importer - env: - GOOS: windows - - - name: Release Build (Windows) - run: go build -ldflags '-s -w -H=windowsgui' -o bin/engarde-importer.exe - env: - GOOS: windows - - - name: Upload Release - uses: ColinPitrat/update-release@v1.0.1 - id: update-release - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: bin/engarde-importer bin/engarde-importer.exe - tag: release + - name: Upload Release + uses: ColinPitrat/update-release@v1.0.1 + id: update-release + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: bin/* + tag: release -- cgit v1.2.3