From 80497fb2a8f03385d1b9d4d066785beea0293e3c Mon Sep 17 00:00:00 2001 From: jabuxas Date: Tue, 3 Sep 2024 22:14:08 -0300 Subject: [PATCH] build: add on-commit github action --- .github/workflows/build.yaml | 37 ++++++++++++++++++++++++++++++++++++ go.mod | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) 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..b400952 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,37 @@ +name: build abyss + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux] + goarch: [amd64, arm64, riscv64, ppc64le] + + steps: + - name: checkout code + uses: actions/checkout@v4 + + - name: set up go + uses: actions/setup-go@v5 + with: + go-version: 1.22.x + + - name: build for ${{ matrix.goarch }} + run: | + export CGO_ENABLED=0 + GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -a -ldflags '-extldflags "-static"' -o abyss-${{ matrix.goarch }} + + - name: upload binaries + uses: actions/upload-artifact@v4 + with: + name: abyss-${{ matrix.goarch }} + path: abyss-${{ matrix.goarch }} diff --git a/go.mod b/go.mod index 617b6d1..bd2aaf7 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/jabuxas/abyss go 1.22.6 -require github.com/joho/godotenv v1.5.1 // indirect +require github.com/joho/godotenv v1.5.1