From 13a00ce8d74940a6e5f1bdb2c19776cb51a30919 Mon Sep 17 00:00:00 2001 From: Shahbaz Nazir Date: Wed, 10 May 2023 13:19:08 +0500 Subject: [PATCH 1/9] fix: use GH_ACCESS_TOKEN for GH access --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dfc56b04..a9429090 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,4 +38,4 @@ jobs: run: make release env: RELEASE: true - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} From c1e17ca610e5be0fb67324dc11243e1bb00423ac Mon Sep 17 00:00:00 2001 From: Shahbaz Nazir Date: Wed, 10 May 2023 13:23:46 +0500 Subject: [PATCH 2/9] fix: Add changelong --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c22712..9659a530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Contains all the PRs that improved the code without changing the behaviours. - Feature request template - General issue template - [#347](https://github.com/archway-network/archway/pull/347) - Unified release for cross compiled binaries and docker images +- [#360](https://github.com/archway-network/archway/pull/360) - Fix github access token for release workflow ### Fixed From 166da65445476c8f42635b70f26dc1b058b86427 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 11:44:49 +0300 Subject: [PATCH 3/9] fix: use GH_ACCESS_TOKEN in deploy pipeline --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 40db21ed..6e3a21df 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -43,7 +43,7 @@ jobs: - name: GoReleaser run: make release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} deploy-titus: runs-on: ubuntu-latest From 71dd7b0c37e945762a98c7f8add2162244966121 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 11:46:35 +0300 Subject: [PATCH 4/9] fix: add github token to release command --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3083119d..03d22cdf 100644 --- a/Makefile +++ b/Makefile @@ -228,6 +228,7 @@ release: -w /code \ -e LIBWASM_VERSION=$(LIBWASM_VERSION) \ -e RELEASE=$(RELEASE) \ + -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ -v /var/run/docker.sock:/var/run/docker.sock \ goreleaser/goreleaser-cross:$(GORELEASER_VERSION) \ --clean From 1195bae25b2bcf28b6bfdadbfa04e5c635c55b5b Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 11:48:12 +0300 Subject: [PATCH 5/9] fix: typo in deploy pipeline --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6e3a21df..62f27fa7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -59,7 +59,7 @@ jobs: - name: Inject version and secrets to titus-1.yaml run: | - sed -i -e "s|NODE_VERSION|${{ steps.vars.outputr.short_sha }}|g" ci/titus-1.yaml + sed -i -e "s|NODE_VERSION|${{ steps.vars.output.short_sha }}|g" ci/titus-1.yaml sed -i -e "s|TITUS_1_ACCOUNT_MNEMONIC_B64|${{ secrets.TITUS_1_ACCOUNT_MNEMONIC_B64 }}|g" ci/titus-1.yaml sed -i -e "s|TITUS_1_FAUCET_ACCOUNT_MNEMONIC_B64|${{ secrets.TITUS_1_FAUCET_ACCOUNT_MNEMONIC_B64 }}|g" ci/titus-1.yaml sed -i -e "s|TITUS_1_PRIV_VALIDATOR_KEY_B64|${{ secrets.TITUS_1_PRIV_VALIDATOR_KEY_B64 }}|g" ci/titus-1.yaml From 9ee59eec47baf6bb030fd0a5088f198d8729ae4d Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 12:05:34 +0300 Subject: [PATCH 6/9] fix: readd deprecated Dockerfile build --- .../workflows/docker-build-deprecated.yaml | 46 ++++++++++++++++ Dockerfile.deprecated | 53 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 .github/workflows/docker-build-deprecated.yaml create mode 100644 Dockerfile.deprecated diff --git a/.github/workflows/docker-build-deprecated.yaml b/.github/workflows/docker-build-deprecated.yaml new file mode 100644 index 00000000..cdca16b0 --- /dev/null +++ b/.github/workflows/docker-build-deprecated.yaml @@ -0,0 +1,46 @@ +name: Build and Deploy + +on: + push: + branches: [main] +jobs: + build-docker-image: + runs-on: ubuntu-latest + + outputs: + image-version: ${{ steps.meta.outputs.version }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USER_NAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set Docker Metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: archwaynetwork/archwayd + tags: | + type=semver,pattern={{raw}} + type=sha + + + - name: Build and push docker image + uses: docker/build-push-action@v2 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + file: Dockerfile.deprecated diff --git a/Dockerfile.deprecated b/Dockerfile.deprecated new file mode 100644 index 00000000..bb1de714 --- /dev/null +++ b/Dockerfile.deprecated @@ -0,0 +1,53 @@ +FROM golang:1.19.5-alpine3.17 AS go-builder +# arch can be either x86_64 for amd64 or aarch64 for arm +ARG arch=x86_64 +ARG libwasmvm_version=v1.1.1 +ARG libwasmvm_aarch64_sha=9ecb037336bd56076573dc18c26631a9d2099a7f2b40dc04b6cae31ffb4c8f9a +ARG libwasmvm_amd64_sha=6e4de7ba9bad4ae9679c7f9ecf7e283dd0160e71567c6a7be6ae47c81ebe7f3 + +# this comes from standard alpine nightly file +# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile +# with some changes to support our toolchain, etc +RUN set -eux; apk add --no-cache ca-certificates build-base; + +RUN apk add git +# NOTE: add these to run with LEDGER_ENABLED=true +# RUN apk add libusb-dev linux-headers + +WORKDIR /code +COPY . /code/ + +# See https://github.com/CosmWasm/wasmvm/releases +ADD https://github.com/CosmWasm/wasmvm/releases/download/$libwasmvm_version/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a +ADD https://github.com/CosmWasm/wasmvm/releases/download/$libwasmvm_version/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep $libwasmvm_aarch64_sha +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep $libwasmvm_amd64_sha + +# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` +RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a + +# force it to use static lib (from above) not standard libgo_cosmwasm.so file +RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build +RUN echo "Ensuring binary is statically linked ..." \ + && (file /code/build/archwayd | grep "statically linked") + +# -------------------------------------------------------- +FROM alpine:3.17 + +COPY --from=go-builder /code/build/archwayd /usr/bin/archwayd + +WORKDIR /root/.archway + +# safety check to ensure deps are correct +RUN archwayd ensure-binary + +# rest server +EXPOSE 1317 +# tendermint p2p +EXPOSE 26656 +# tendermint rpc +EXPOSE 26657 + +ENTRYPOINT [ "/usr/bin/archwayd" ] + +CMD [ "help" ] From 8bea2bec431a56e8ca66fb11c5db42e336f77770 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 12:13:43 +0300 Subject: [PATCH 7/9] fix: add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9659a530..d670a43d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Contains all the PRs that improved the code without changing the behaviours. - General issue template - [#347](https://github.com/archway-network/archway/pull/347) - Unified release for cross compiled binaries and docker images - [#360](https://github.com/archway-network/archway/pull/360) - Fix github access token for release workflow +- [#361](https://github.com/archway-network/archway/pull/361) - Readd missing deprecated Dockerhub build phase ### Fixed From 53cacf180bc0c9d859712414e9f031e2fc9080a3 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 12:21:18 +0300 Subject: [PATCH 8/9] fix: rename the pipeline --- .github/workflows/docker-build-deprecated.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-deprecated.yaml b/.github/workflows/docker-build-deprecated.yaml index cdca16b0..90e1d1f0 100644 --- a/.github/workflows/docker-build-deprecated.yaml +++ b/.github/workflows/docker-build-deprecated.yaml @@ -1,4 +1,5 @@ -name: Build and Deploy +# DEPRECATED +name: Build deprecated docker image on: push: From 7ef90f7b754b78fe7bf9f61f5799bd9550d3dbdf Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Wed, 10 May 2023 12:28:03 +0300 Subject: [PATCH 9/9] fix: wrong reference in the deploy pipeline --- .github/workflows/deploy.yaml | 2 +- CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 62f27fa7..a3059325 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest needs: - - build-docker-image + - release-dev steps: - name: Checkout code diff --git a/CHANGELOG.md b/CHANGELOG.md index d670a43d..52852f84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Contains all the PRs that improved the code without changing the behaviours. - [#347](https://github.com/archway-network/archway/pull/347) - Unified release for cross compiled binaries and docker images - [#360](https://github.com/archway-network/archway/pull/360) - Fix github access token for release workflow - [#361](https://github.com/archway-network/archway/pull/361) - Readd missing deprecated Dockerhub build phase +- [#362](https://github.com/archway-network/archway/pull/362) - wrong reference in the deploy pipeline ### Fixed