From 6fcbb998a7007f98bc694d574d9983353642b636 Mon Sep 17 00:00:00 2001 From: lanath Date: Tue, 22 Oct 2024 17:17:28 +0200 Subject: [PATCH] ci: adding github action to build go binaries --- .github/workflows/build.yaml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..a94d32d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,50 @@ +name: Build go binaries + +on: push + +jobs: + build-stamusctl: + runs-on: ${{ matrix.runner }} + strategy: + matrix: + include: + - { runner: macos-latest, os: darwin, arch: amd64 } + - { runner: ubuntu-latest, os: linux, arch: amd64, go-version: 1.22 } + - { runner: ubuntu-latest, os: windows, arch: amd64 } + # - { runner: macos-latest, os: darwin, arch: arm64 } + steps: + - uses: actions/checkout@v4 + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - name: Build + run: make cli + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: stamusctl-${{matrix.os}}-${{matrix.arch}} + path: dist/* + + build-stamusdaemon: + runs-on: ${{ matrix.runner }} + strategy: + matrix: + include: + - { runner: macos-latest, os: darwin, arch: amd64 } + - { runner: ubuntu-latest, os: windows, arch: amd64 } + - { runner: ubuntu-latest, os: linux, arch: amd64, go-version: 1.22 } + # - { runner: macos-latest, os: darwin, arch: arm64 } + steps: + - uses: actions/checkout@v4 + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - name: Build + run: make daemon + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: stamusd-${{matrix.os}}-${{matrix.arch}} + path: dist/*