Skip to content

Commit 24a36ba

Browse files
authored
port astria changes on top of upstream release v1.12.0 (#31)
1 parent a2e8437 commit 24a36ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2064
-356
lines changed

.github/workflows/docker.yml

Lines changed: 51 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,71 @@
1-
# Build Hermes Docker image, push to Docker Hub and GHCR.io.
1+
# Build Hermes Docker image, push to GHCR.io.
22

33
name: Docker
44

55
on:
66
workflow_dispatch:
77
push:
88
tags:
9-
- v[0-9]+.*
9+
- "v[0-9]+.[0-9]+.[0-9]+"
10+
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
11+
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
12+
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
13+
pull_request:
14+
branches:
15+
- astria
16+
- upstream-v1.12.0
1017

1118
env:
12-
REGISTRY_IMAGE: informalsystems/hermes
19+
REGISTRY: ghcr.io
20+
FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}
1321

1422
jobs:
15-
docker-build:
23+
build-and-push:
1624
runs-on: ubuntu-latest
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
platform:
21-
- id: linux/amd64
22-
name: amd64
23-
- id: linux/arm64
24-
name: arm64
25+
permissions:
26+
contents: read
27+
id-token: write
28+
packages: write
2529
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v4
28-
29-
- name: Docker meta
30-
id: meta
31-
uses: docker/metadata-action@v5
30+
# Checking out the repo
31+
- uses: actions/checkout@v4
3232
with:
33-
images: ${{ env.REGISTRY_IMAGE }}
34-
tags: |
35-
type=ref,event=tag
36-
type=ref,event=branch
37-
type=semver,pattern={{version}}
38-
39-
- name: Set up QEMU
40-
uses: docker/setup-qemu-action@v3
41-
42-
- name: Set up Docker Buildx
43-
id: buildx
44-
uses: docker/setup-buildx-action@v3
45-
33+
ref: ${{ inputs.tag }}
34+
- uses: depot/setup-action@v1
4635
- name: Login to Docker Hub
47-
uses: docker/login-action@v3
48-
with:
49-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
50-
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
51-
52-
- name: Build and push by digest
53-
id: build
54-
uses: docker/build-push-action@v6
36+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/hermes'
37+
uses: docker/login-action@v2
5538
with:
56-
context: .
57-
file: ./ci/release/hermes.Dockerfile
58-
platforms: ${{ matrix.platform.id }}
59-
labels: ${{ steps.meta.outputs.labels }}
60-
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
61-
cache-from: type=gha
62-
cache-to: type=gha,mode=max
63-
64-
- name: Export digest
65-
run: |
66-
mkdir -p /tmp/digests
67-
digest="${{ steps.build.outputs.digest }}"
68-
touch "/tmp/digests/${digest#sha256:}"
69-
70-
- name: Upload digest
71-
uses: actions/upload-artifact@v4
72-
with:
73-
name: digests-${{ matrix.platform.name }}
74-
path: /tmp/digests/*
75-
if-no-files-found: error
76-
retention-days: 1
77-
78-
docker-merge:
79-
runs-on: ubuntu-latest
80-
needs:
81-
- docker-build
82-
steps:
83-
- name: Download digests
84-
uses: actions/download-artifact@v4
39+
username: ${{ secrets.DOCKER_USER }}
40+
password: ${{ secrets.DOCKER_TOKEN }}
41+
- name: Log in to GHCR
42+
uses: docker/login-action@v2
8543
with:
86-
pattern: digests-*
87-
merge-multiple: true
88-
path: /tmp/digests
89-
90-
- name: Set up Docker Buildx
91-
uses: docker/setup-buildx-action@v3
92-
93-
- name: Docker meta
94-
id: meta
95-
uses: docker/metadata-action@v5
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
# Generate correct tabs and labels
48+
- name: Docker metadata
49+
id: metadata
50+
uses: docker/metadata-action@v4
9651
with:
97-
images: ${{ env.REGISTRY_IMAGE }}
52+
images: ghcr.io/astriaorg/hermes
9853
tags: |
99-
type=ref,event=tag
100-
type=ref,event=branch
101-
type=semver,pattern={{version}}
102-
103-
- name: Login to Docker Hub
104-
uses: docker/login-action@v3
54+
type=ref,event=pr
55+
type=match,pattern=refs/tags/v(.*),group=1,enable=${{ startsWith(env.FULL_REF, 'refs/tags/') }},value=${{ env.FULL_REF }}
56+
type=sha
57+
# set latest tag for `main` branch
58+
type=raw,value=latest,enable=${{ env.FULL_REF == format('refs/heads/{0}', 'main') }}
59+
- name: Build and push
60+
uses: depot/build-push-action@v1
10561
with:
106-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
107-
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
108-
109-
- name: Create manifest list and push
110-
working-directory: /tmp/digests
111-
run: |
112-
docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \
113-
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
114-
115-
- name: Inspect image
116-
run: |
117-
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
118-
119-
- name: Login to GitHub Container Registry
120-
uses: docker/login-action@v3
121-
with:
122-
registry: ghcr.io
123-
username: ${{ github.repository_owner }}
124-
password: ${{ secrets.GITHUB_TOKEN }}
125-
126-
- name: Push image to GHCR
127-
run: |
128-
docker buildx imagetools create \
129-
--tag ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \
130-
${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
62+
# this gets rid of the unknown/unknown image that is created without this setting
63+
# https://github.com/docker/build-push-action/issues/820#issuecomment-1455687416
64+
provenance: false
65+
context: .
66+
file: ci/release/hermes.Dockerfile
67+
platforms: "linux/amd64,linux/arm64"
68+
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/hermes' }}
69+
tags: ${{ steps.metadata.outputs.tags }}
70+
labels: ${{ steps.metadata.outputs.labels }}
71+
project: qz2p12cbtf

Cargo.lock

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/release/hermes.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Usage: (from the root of the working copy)
44
# $ docker build . -t informalsystems/hermes -f ci/release/hermes.Dockerfile
55

6-
FROM rust:1-buster AS build-env
6+
FROM rust:1-bullseye AS build-env
77

88
ARG TAG
99
ARG PROTOC_VERSION=28.3
@@ -23,6 +23,8 @@ RUN ARCH=$(uname -m) && \
2323
unzip /tmp/protoc.zip -d /usr/local && \
2424
rm -rf /tmp/protoc.zip
2525

26+
RUN apt update && apt install -y clang libssl-dev pkg-config
27+
2628
COPY . .
2729
RUN cargo build --release
2830

@@ -39,7 +41,7 @@ WORKDIR /home/hermes
3941

4042
RUN ARCH=$(uname -m) && \
4143
if [ "$ARCH" = "x86_64" ]; then \
42-
DEB_URL=http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb; \
44+
DEB_URL=http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb; \
4345
elif [ "$ARCH" = "aarch64" ]; then \
4446
DEB_URL=http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \
4547
else \

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.79.0"
1+
msrv = "1.83.0"

crates/chain-registry/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "Apache-2.0"
66
keywords = ["cosmos", "ibc", "relayer", "chain", "registry"]
77
repository = "https://github.com/informalsystems/hermes"
88
authors = ["Informal Systems <[email protected]>"]
9-
rust-version = "1.79.0"
9+
rust-version = "1.83.0"
1010
description = """
1111
Service to fetch data from the chain-registry
1212
"""

crates/relayer-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"]
88
homepage = "https://hermes.informal.systems/"
99
repository = "https://github.com/informalsystems/hermes"
1010
authors = ["Informal Systems <[email protected]>"]
11-
rust-version = "1.79.0"
11+
rust-version = "1.83.0"
1212
description = """
1313
Hermes is an IBC Relayer written in Rust
1414
"""

0 commit comments

Comments
 (0)