diff --git a/.github/workflows/axelar.yml b/.github/workflows/axelar.yml new file mode 100644 index 00000000..d1d00397 --- /dev/null +++ b/.github/workflows/axelar.yml @@ -0,0 +1,52 @@ +name: Build and Push Axelar Docker Image + +on: + push: + tags: + - "axelar-v[0-9]+.[0-9]+.[0-9]+" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + INFRA_TOOLKIT: v0.1.6 + +jobs: + build-and-push-axelar: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.21' + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + + - name: Build Heighliner binary + run: | + go build -o heighliner + + - name: Extract version from tag + id: extract_version + run: echo "VERSION=${GITHUB_REF#refs/tags/axelar-}" >> $GITHUB_ENV + + - name: Manually pull the base Docker image + run: | + echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + docker pull ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 + + - name: Build and push Axelar Docker image + run: | + ./heighliner build -c axelar --alpine-version 3.18 --git-ref ${{ env.VERSION }} diff --git a/README.md b/README.md index f51398cc..8169b33b 100644 --- a/README.md +++ b/README.md @@ -90,22 +90,22 @@ Docker image `somegaia:v8.0.0-somefork` will be built and stored in your local d ```shell # docker login ... -heighliner build -r ghcr.io/p2p-org/heighliner -c gaia -g v6.0.0 +heighliner build -r ghcr.io/p2p-org/cosmos-heighliner -c gaia -g v6.0.0 ``` -Docker image `ghcr.io/p2p-org/heighliner/gaia:v6.0.0` will be built and pushed to ghcr.io +Docker image `ghcr.io/p2p-org/cosmos-heighliner/gaia:v6.0.0` will be built and pushed to ghcr.io #### Example: build and push last n releases of osmosis chain ```shell # docker login ... -heighliner build -r ghcr.io/p2p-org/heighliner -c osmosis -n 3 +heighliner build -r ghcr.io/p2p-org/cosmos-heighliner -c osmosis -n 3 ``` heighliner will fetch the last 3 osmosis release tags from github, build docker images, and push them, e.g.: -- `ghcr.io/p2p-org/heighliner/osmosis:v6.1.0` -- `ghcr.io/p2p-org/heighliner/osmosis:v6.0.0` -- `ghcr.io/p2p-org/heighliner/osmosis:v5.0.0` +- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v6.1.0` +- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v6.0.0` +- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v5.0.0` #### Example: build and push last n releases of all chains @@ -114,7 +114,7 @@ This will make a request to each chain's Github repository to fetch all recent r ```shell # docker login ... export GH_USER=github_username GH_PAT=github_personal_access_token -heighliner build -r ghcr.io/p2p-org/heighliner -n 3 +heighliner build -r ghcr.io/p2p-org/cosmos-heighliner -n 3 ``` heighliner will fetch the last 3 release tags from github for all chains in [chains.yaml](./chains.yaml), build docker images, and push them. @@ -143,7 +143,7 @@ Docker images for `heighliner/gaia:v7.0.1` will now be available in your local d #### Example: Use custom buildkit server, build x64 and arm64 docker images for gaia v7.0.1, and push: ```shell -heighliner build -b --buildkit-addr tcp://192.168.1.5:8125 -c gaia -g v7.0.1 -r ghcr.io/p2p-org/heighliner +heighliner build -b --buildkit-addr tcp://192.168.1.5:8125 -c gaia -g v7.0.1 -r ghcr.io/p2p-org/cosmos-heighliner ``` Docker images for `heighliner/gaia:v7.0.1` will be built on the remote buildkit server and then pushed to the container repository. The manifest for the tag will contain both amd64 and arm64 images. diff --git a/chains.yaml b/chains.yaml index 1dec0f36..506953d6 100644 --- a/chains.yaml +++ b/chains.yaml @@ -180,27 +180,14 @@ github-organization: axelarnetwork github-repo: axelar-core dockerfile: cosmos + build-env: + - BUILD_TAGS=muslc binaries: - bin/axelard build-target: | set -eux - apk add --update nodejs npm jq py3-pip - CONTRACT_VERSION=$(cat contract-version.json | jq -r '.gateway') - git clone -b ${CONTRACT_VERSION} --single-branch https://github.com/axelarnetwork/axelar-cgp-solidity.git - cd axelar-cgp-solidity - # The npm commands will complain about nodejs versions but will proceed. - # See issue: https://github.com/p2p-org/heighliner/issues/92 - npm ci - npm run build - # prettier + alpine + certain versions of the flatten-contracts scripts fail during prettier write, which is not fully necessary since hardhat flatten still outputs artifacts - sed -i '/prettier/d' scripts/flatten-contracts.sh - npm run flatten - mkdir -p ../contract-artifacts/gateway - mv artifacts/* ../contract-artifacts/ - cd .. VERSION=$(echo $(git describe --tags) | sed 's/^v//') COMMIT=$(git log -1 --format='%H') - BUILD_TAGS=muslc LDFLAGS="$LDFLAGS -X github.com/cosmos/cosmos-sdk/version.Name=axelar \ -X github.com/cosmos/cosmos-sdk/version.AppName=axelard \ -X github.com/cosmos/cosmos-sdk/version.Version=$VERSION \ diff --git a/dockerfile/avalanche/Dockerfile b/dockerfile/avalanche/Dockerfile index 48f2b0f8..921d020c 100644 --- a/dockerfile/avalanche/Dockerfile +++ b/dockerfile/avalanche/Dockerfile @@ -101,7 +101,7 @@ RUN bash -c 'set -eux;\ LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/avalanche/native.Dockerfile b/dockerfile/avalanche/native.Dockerfile index 0044f9c8..2ac41f90 100644 --- a/dockerfile/avalanche/native.Dockerfile +++ b/dockerfile/avalanche/native.Dockerfile @@ -78,7 +78,7 @@ RUN bash -c 'set -eux;\ LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/cargo/Dockerfile b/dockerfile/cargo/Dockerfile index 84d43be4..36410777 100644 --- a/dockerfile/cargo/Dockerfile +++ b/dockerfile/cargo/Dockerfile @@ -146,7 +146,7 @@ RUN bash -c 'set -eux;\ done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/cargo/native.Dockerfile b/dockerfile/cargo/native.Dockerfile index a5ce69c8..dff8b3c1 100644 --- a/dockerfile/cargo/native.Dockerfile +++ b/dockerfile/cargo/native.Dockerfile @@ -160,7 +160,7 @@ RUN bash -c 'set -eux;\ done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/cosmos/Dockerfile b/dockerfile/cosmos/Dockerfile index 21440c3f..8272851b 100644 --- a/dockerfile/cosmos/Dockerfile +++ b/dockerfile/cosmos/Dockerfile @@ -119,7 +119,7 @@ RUN bash -c 'set -eux;\ LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/cosmos/local.Dockerfile b/dockerfile/cosmos/local.Dockerfile index 4e3976ba..e44bf47d 100644 --- a/dockerfile/cosmos/local.Dockerfile +++ b/dockerfile/cosmos/local.Dockerfile @@ -33,7 +33,7 @@ RUN set -eux; \ fi; # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/cosmos/localcross.Dockerfile b/dockerfile/cosmos/localcross.Dockerfile index bba55125..dd52f287 100644 --- a/dockerfile/cosmos/localcross.Dockerfile +++ b/dockerfile/cosmos/localcross.Dockerfile @@ -106,7 +106,7 @@ RUN bash -c 'set -eux;\ LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/cosmos/native.Dockerfile b/dockerfile/cosmos/native.Dockerfile index 0e640b8d..a640cb6d 100644 --- a/dockerfile/cosmos/native.Dockerfile +++ b/dockerfile/cosmos/native.Dockerfile @@ -93,7 +93,7 @@ RUN bash -c 'set -eux;\ LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done' # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image diff --git a/dockerfile/imported/Dockerfile b/dockerfile/imported/Dockerfile index 94e140f0..e6ae120f 100644 --- a/dockerfile/imported/Dockerfile +++ b/dockerfile/imported/Dockerfile @@ -3,7 +3,7 @@ ARG VERSION FROM $BASE_IMAGE:$VERSION AS imported # Use minimal busybox from infra-toolkit image for final scratch image -FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit +FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p # Use ln and rm from full featured busybox for assembling final image