From 21bae6199fea7aab304fad59f3bda943772a88c7 Mon Sep 17 00:00:00 2001 From: Chuck Bear Date: Wed, 20 Mar 2024 15:26:42 -0400 Subject: [PATCH] bet(build): try to build binaries --- .github/workflows/build.yaml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 33 +++++++++++++++++++++++++++++++++ Makefile | 2 ++ 3 files changed, 69 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000000..74d9552312 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,34 @@ +# This is a basic workflow that is manually triggered + +name: compile beacond + +on: [pull_request, push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64, arm64] + targetos: [darwin, linux] + + name: beacond ${{ matrix.arch }} for ${{ matrix.targetos }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: "^1.22" + env: + GOOS: ${{ matrix.targetos }} + GOARCH: ${{ matrix.arch }} + + # Build and capture an artifact + - name: Compile becond + run: | + make build + + # Uploads binaries + - uses: actions/upload-artifact@v3 + with: + name: beacond-${{ matrix.targetos }}-${{ matrix.arch }} + path: build/bin/beacond \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000000..1c35aa065d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: "Release" + +on: + push: + tags: + - v* +jobs: + draft-release: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Copy Binary + run: | + make build-all + + - name: Draft Release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: | + beacond_linux_arm64 + beacond_linux_amd64 + beacond_sha256.txt + \ No newline at end of file diff --git a/Makefile b/Makefile index 8333344df2..ddf480e94e 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(OUT_DIR)/beacond +build-all: build build-linux-amd64 build-linux-arm64 + build-linux-amd64: GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build