From 1814a74267447e32c2c614129c2519427357b551 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Tue, 3 Oct 2023 15:37:57 +0200 Subject: [PATCH] Add relase --- .github/workflows/release.yml | 37 +++++++++++++++++++++++ .goreleaser-build.yaml | 57 +++++++++++++++++++++++++++++++++++ Makefile | 10 ++++++ 3 files changed, 104 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser-build.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..ee2f2dfa1c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release + +on: + push: + branches-ignore: + - "**" + tags: + - "v*.*.*" + # to be used by fork patch-releases ^^ + - "v*.*.*-*" + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@master + with: + go-version: 1.20.x + + - name: Prepare + id: prepare + run: | + TAG=${GITHUB_REF#refs/tags/} + echo ::set-output name=tag_name::${TAG} + + - name: Run GoReleaser + run: | + make release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ steps.prepare.outputs.tag_name }} diff --git a/.goreleaser-build.yaml b/.goreleaser-build.yaml new file mode 100644 index 0000000000..e737ccc047 --- /dev/null +++ b/.goreleaser-build.yaml @@ -0,0 +1,57 @@ +project_name: suave +builds: + - id: darwin-arm64 + main: ./cmd/geth + binary: suave + goos: + - darwin + goarch: + - arm64 + env: + - CC=oa64-clang + - CXX=oa64-clang++ + tags: + - netgo + ldflags: -s -w + + - id: darwin-amd64 + main: ./cmd/geth + binary: suave + goos: + - darwin + goarch: + - amd64 + env: + - CC=o64-clang + - CXX=o64-clang++ + tags: + - netgo + ldflags: -s -w + + - id: linux-amd64 + main: ./cmd/geth + binary: suave + goos: + - linux + goarch: + - amd64 + env: + - CC=gcc + - CXX=g++ + tags: + - netgo + ldflags: -s -w -extldflags "-static" + + - id: linux-arm64 + main: ./cmd/geth + binary: suave + goos: + - linux + goarch: + - arm64 + env: + - CC=aarch64-linux-gnu-gcc + - CXX=aarch64-linux-gnu-g++ + tags: + - netgo + ldflags: -s -w -extldflags "-static" diff --git a/Makefile b/Makefile index 6ca8096dd7..612debff74 100644 --- a/Makefile +++ b/Makefile @@ -52,3 +52,13 @@ devnet-up: devnet-down: docker-compose -f ./suave/devenv/docker-compose.yml down + +release: + docker run \ + --rm --privileged \ + -e CGO_ENABLED=1 \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(HOME)/.docker/config.json:/root/.docker/config.json \ + -v `pwd`:/go/src/$(PACKAGE_NAME) -w /go/src/$(PACKAGE_NAME) \ + goreleaser/goreleaser-cross:v1.20.5 \ + --skip-publish --config .goreleaser-build.yaml --rm-dist --snapshot