From 4a87d6bff5f918e6adf7d6be764112d24c0e1bcd Mon Sep 17 00:00:00 2001 From: Octo-node Date: Sat, 5 Aug 2023 13:33:35 +0200 Subject: [PATCH 1/3] attempt #1 --- .github/workflows/build.yml | 15 ++++++--------- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 2 +- Makefile | 8 +++++--- 4 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f2664e..f381a8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,25 +22,22 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 - with: - go-version: '^1.19' + with: + go-version: "^1.19" env: GOOS: ${{ matrix.targetos }} GOARCH: ${{ matrix.arch }} - - + - name: run tests run: go test ./... -# we build and install in case we want to run it or capture an artifact as we do in the step below. + # we build and install in case we want to run it or capture an artifact as we do in the step below. - name: Compile chihuahuad run: | go build ./... go install ./... - - - -# now uploads genesis.json and bin + + # now uploads genesis.json and bin - uses: actions/upload-artifact@v3 with: name: chihuahuad ${{ matrix.targetos }} ${{ matrix.arch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..278cf01 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +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-reproducible-all + + - name: Draft Release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: | + chihuahuad_linux_arm64 + chihuahuad_linux_amd64 + chihuahuad_sha256.txt diff --git a/Dockerfile b/Dockerfile index 3dce021..4b89d24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG IMG_TAG=latest ARG PLATFORM="linux/amd64" -ARG GO_VERSION="1.20" +ARG GO_VERSION="1.19" ARG RUNNER_IMAGE="gcr.io/distroless/static" FROM --platform=${PLATFORM} golang:${GO_VERSION}-alpine as builder diff --git a/Makefile b/Makefile index 3cee3ab..0e88f67 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ BRANCH := $(shell git rev-parse --abbrev-ref HEAD) COMMIT := $(shell git log -1 --format='%H') +GO_VERSION := "1.20" # don't override user values ifeq (,$(VERSION)) @@ -110,16 +111,17 @@ build-reproducible-generic: go.sum $(DOCKER) rm $(subst /,-,latest-build-$(PLATFORM)) || true DOCKER_BUILDKIT=1 $(DOCKER) build -t latest-build-$(PLATFORM) \ --build-arg ARCH=$(ARCH) \ + --build-arg GO_VERSION=$(GO_VERSION) \ --build-arg PLATFORM=$(PLATFORM) \ --build-arg VERSION="$(VERSION)" \ -f Dockerfile . $(DOCKER) create -ti --name $(subst /,-,latest-build-$(PLATFORM)) latest-build-$(PLATFORM) chihuahuad - mkdir -p $(BUILDDIR)/$(NETWORK)/$(PLATFORM)/ - $(DOCKER) cp -a $(subst /,-,latest-build-$(PLATFORM)):/usr/local/bin/chihuahuad $(BUILDDIR)/$(NETWORK)/$(PLATFORM)/chihuahuad + $(DOCKER) cp -a $(subst /,-,latest-build-$(PLATFORM)):/usr/local/bin/chihuahuad chihuahuad_$(subst /,_,$(PLATFORM)) + sha256sum chihuahuad_$(subst /,_,$(PLATFORM)) >> ./chihuahuad_sha256.txt # Add check to make sure we are using the proper Go version before proceeding with anything check-go-version: - @if ! go version | grep -q "go1.19"; then \ + @if ! go version | grep -q "go$(GO_VERSION)"; then \ echo "\033[0;31mERROR:\033[0m Go version 1.19 is required for compiling chihuahuad. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version 1.19 and retry. Thank you!"; \ exit 1; \ fi \ No newline at end of file From 935b7587731c9f5b32c23a578be4e726c2c53d3a Mon Sep 17 00:00:00 2001 From: Octo-node Date: Sat, 5 Aug 2023 22:29:10 +0200 Subject: [PATCH 2/3] mising go version in error message --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0e88f67..b5653e2 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,6 @@ build-reproducible-generic: go.sum # Add check to make sure we are using the proper Go version before proceeding with anything check-go-version: @if ! go version | grep -q "go$(GO_VERSION)"; then \ - echo "\033[0;31mERROR:\033[0m Go version 1.19 is required for compiling chihuahuad. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version 1.19 and retry. Thank you!"; \ + echo "\033[0;31mERROR:\033[0m Go version $(GO_VERSION) is required for compiling chihuahuad. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version $(GO_VERSION) and retry. Thank you!"; \ exit 1; \ fi \ No newline at end of file From 31d7de92cf9612d39835517552eeb07e48bf1862 Mon Sep 17 00:00:00 2001 From: woof-chihuahua <123602654+woof-chihuahua@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:12:56 +0100 Subject: [PATCH 3/3] Update README.md updated readme to reflect current version --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6fa6e4b..7fd92bf 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ sudo apt-get install make build-essential gcc git jq chrony -y ```bash # download the latest version -wget https://go.dev/dl/go1.19.2.linux-amd64.tar.gz +wget https://go.dev/dl/go1.20.6.linux-amd64.tar.gz # remove old version (if any) sudo rm -rf /usr/local/go # install the new version -sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.20.6.linux-amd64.tar.gz ``` - #### Configure Environmental Variables @@ -47,7 +47,7 @@ source ~/.profile go version ``` -The output should be `go version go1.19 linux/amd64` +The output should be `go version go1.20.6 linux/amd64` - #### Install Chihuahua from sources @@ -56,11 +56,11 @@ The output should be `go version go1.19 linux/amd64` git clone https://github.com/ChihuahuaChain/chihuahua.git cd chihuahua git fetch --tags -git checkout v4.2.3 +git checkout v5.0.0 make install ``` -To verify the installation you can run `chihuahuad version` and it should return `v4.2.3` +To verify the installation you can run `chihuahuad version` and it should return `v5.0.0` - #### Initialize the Chain Replace `$MONIKERNAME` with your choosen node name