diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index f5c429d..a2d8515 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -10,23 +10,48 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + os: [linux, darwin] + arch: [amd64] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.18 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.18 - - name: Build - env: - GOOS: linux - GOARCH: amd64 - run: go build -v -o "bob-$GOOS-$GOARCH" - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/v') - with: - generate_release_notes: true - files: bob-* + - name: Build + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + run: | + mkdir bin + go build -v -o "bin/bob-$GOOS-$GOARCH-$GITHUB_REF_NAME" + + - name: Upload + uses: actions/upload-artifact@v3 + if: startsWith(github.ref, 'refs/tags/v') + with: + name: binaries + path: bin/* + + release: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download + uses: actions/download-artifact@v3 + if: startsWith(github.ref, 'refs/tags/v') + with: + name: binaries + path: bin/ + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + generate_release_notes: true + files: bin/*