Skip to content

Commit

Permalink
build: build yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
calloc134 committed Apr 15, 2024
1 parent 86e2931 commit 41bdcef
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 41bdcef

Please sign in to comment.