diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..1a33f52 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,36 @@ +name: Go Build + +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + go-version: [1.18.x] + os: [linux, darwin, windows] + arch: [amd64, arm64] + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + - name: Check out code + uses: actions/checkout@v3 + + - name: Set filename for Windows + if: matrix.os == 'windows' + run: echo filename=openapi2runn-${{ matrix.os }}-${{ matrix.arch }}.exe > $GITHUB_ENV + - name: Set filename for non-Windows + if: matrix.os != 'windows' + run: echo filename=openapi2runn-${{ matrix.os }}-${{ matrix.arch }} > $GITHUB_ENV + + - name: Build + run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -v -o ${{ env.filename }} + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: openapi2runn-${{ matrix.os }}-${{ matrix.arch }} + path: ${{ env.filename }}