Skip to content

Commit 77960c6

Browse files
committed
feat: titab/update release (#102)
* update docs * update defaults * update release CI
1 parent dddec62 commit 77960c6

File tree

16 files changed

+202
-125
lines changed

16 files changed

+202
-125
lines changed

.github/workflows/draft-release.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Draft Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
BINARY_NAME: commit-boost
10+
11+
permissions:
12+
contents: write
13+
packages: write
14+
15+
jobs:
16+
build-binaries:
17+
strategy:
18+
matrix:
19+
include:
20+
- target: x86_64-unknown-linux-gnu
21+
os: ubuntu-latest
22+
- target: x86_64-pc-windows-gnu
23+
os: windows-latest
24+
- target: x86_64-apple-darwin
25+
os: macos-latest
26+
- target: aarch64-apple-darwin
27+
os: macos-latest
28+
29+
runs-on: ${{ matrix.os }}
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
# with:
34+
# ref: "stable"
35+
36+
- name: Install GNU toolchain (Windows)
37+
if: matrix.target == 'x86_64-pc-windows-gnu'
38+
uses: msys2/setup-msys2@v2
39+
with:
40+
msystem: MINGW64
41+
update: true
42+
install: mingw-w64-x86_64-gcc
43+
44+
- name: Set up Rust
45+
uses: actions-rs/toolchain@v1
46+
with:
47+
profile: minimal
48+
toolchain: stable
49+
override: true
50+
target: ${{ matrix.target }}
51+
52+
- name: Build binary
53+
uses: actions-rs/cargo@v1
54+
with:
55+
command: build
56+
args: --release --target ${{ matrix.target }} --bin ${{ env.BINARY_NAME }}
57+
env:
58+
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: gcc
59+
60+
- name: Package binary (Unix)
61+
if: runner.os != 'Windows'
62+
run: |
63+
cd target/${{ matrix.target }}/release
64+
tar -czvf ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ${{ env.BINARY_NAME }}
65+
mv ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ../../../
66+
67+
- name: Package binary (Windows)
68+
if: runner.os == 'Windows'
69+
run: |
70+
cd target/${{ matrix.target }}/release
71+
7z a ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.zip ${{ env.BINARY_NAME }}.exe
72+
move ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.zip ../../../
73+
74+
- name: Upload binary to release
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
files: ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.${{ runner.os == 'Windows' && 'zip' || 'tar.gz' }}
78+
draft: true
79+
token: ${{ secrets.GITHUB_TOKEN }}
80+
81+
build-and-push-docker:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Checkout code
85+
uses: actions/checkout@v4
86+
# with:
87+
# ref: "stable"
88+
89+
- name: Set up Docker Buildx
90+
uses: docker/setup-buildx-action@v3
91+
92+
- name: Login to GitHub Container Registry
93+
uses: docker/login-action@v3
94+
with:
95+
registry: ghcr.io
96+
username: ${{ github.actor }}
97+
password: ${{ secrets.GITHUB_TOKEN }}
98+
99+
- name: Prepare Docker metadata
100+
id: meta
101+
uses: docker/metadata-action@v4
102+
with:
103+
images: |
104+
ghcr.io/${{ github.repository_owner }}/${{ env.DOCKER_IMAGE_NAME }}
105+
tags: |
106+
type=semver,pattern={{version}}
107+
type=semver,pattern={{major}}.{{minor}}
108+
type=raw,value=latest,enable={{is_default_branch}}
109+
110+
- name: Build and push PBS Docker image
111+
uses: docker/build-push-action@v6
112+
with:
113+
context: .
114+
push: true
115+
tags: |
116+
ghcr.io/commit-boost/pbs:${{ github.ref_name }}
117+
ghcr.io/commit-boost/pbs:latest
118+
cache-from: type=gha
119+
cache-to: type=gha,mode=max
120+
file: docker/pbs.Dockerfile
121+
122+
- name: Build and push Signer Docker image
123+
uses: docker/build-push-action@v6
124+
with:
125+
context: .
126+
push: true
127+
tags: |
128+
ghcr.io/commit-boost/signer:${{ github.ref_name }}
129+
ghcr.io/commit-boost/signer:latest
130+
cache-from: type=gha
131+
cache-to: type=gha,mode=max
132+
file: docker/pbs.Dockerfile
133+
134+
finalize-release:
135+
needs: [build-binaries, build-and-push-docker]
136+
runs-on: ubuntu-latest
137+
steps:
138+
- name: Finalize Release
139+
uses: softprops/action-gh-release@v2
140+
with:
141+
name: ${{ github.ref_name }}
142+
tag_name: ${{ github.ref_name }}
143+
draft: true
144+
prerelease: false

config.example.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ chain = "Holesky"
66

77
# Configuration for the PBS module
88
[pbs]
9-
# Docker image to use for the PBS module. This currently defaults to the image built in `scripts/build_local_images.sh` and will be
10-
# replaced by the official Commit-Boost PBS module once published in a public registry
11-
# OPTIONAL, DEFAULT: commitboost_pbs_default
12-
docker_image = "commitboost_pbs_default"
9+
# Docker image to use for the PBS module.
10+
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/pbs:latest
11+
docker_image = "ghcr.io/commit-boost/pbs:latest"
1312
# Whether to enable the PBS module to request signatures from the Signer module (not used in the default PBS image)
1413
# OPTIONAL, DEFAULT: false
1514
with_signer = false
@@ -85,10 +84,9 @@ frequency_get_header_ms = 300
8584
# Configuration for the Signer Module, only required if any `commit` module is present, or if `pbs.with_signer = true`
8685
# OPTIONAL
8786
[signer]
88-
# Docker image to use for the Signer module. This currently defaults to the image built in `scripts/build_local_images.sh` and will be
89-
# replaced by the official Commit-Boost Signer module once published in a public registry
90-
# OPTIONAL, DEFAULT: commitboost_signer
91-
docker_image = "commitboost_signer"
87+
# Docker image to use for the Signer module.
88+
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/signer:latest
89+
docker_image = "ghcr.io/commit-boost/signer:latest"
9290
# Configuration for how the Signer module should load validator keys. Currently two types of loaders are supported:
9391
# - File: load keys from a plain text file (unsafe, use only for testing purposes)
9492
# - ValidatorsDir: load keys from a `keys` and `secrets` folder (ERC-2335 style keystores as used in Lighthouse)

crates/cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "cb-cli"
33
version.workspace = true
44
edition.workspace = true
55
rust-version.workspace = true
6+
publish = false
67

78
[dependencies]
89
cb-common.workspace = true

crates/cli/src/docker_init.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use eyre::Result;
1919
use indexmap::IndexMap;
2020
use serde::Serialize;
2121

22-
pub(super) const CB_CONFIG_FILE: &str = "cb-config.toml";
2322
pub(super) const CB_COMPOSE_FILE: &str = "cb.docker-compose.yml";
2423
pub(super) const CB_ENV_FILE: &str = ".cb.env";
2524
pub(super) const CB_TARGETS_FILE: &str = "targets.json"; // needs to match prometheus.yml

crates/cli/src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
use cb_common::utils::print_logo;
22
use clap::{Parser, Subcommand};
3-
use docker_init::{CB_COMPOSE_FILE, CB_CONFIG_FILE, CB_ENV_FILE};
3+
use docker_init::{CB_COMPOSE_FILE, CB_ENV_FILE};
44

55
mod docker_cmd;
66
mod docker_init;
77

88
#[derive(Parser, Debug)]
9-
#[command(version, about)]
9+
#[command(version, about, long_about = LONG_ABOUT, name = "commit-boost-cli")]
1010
pub struct Args {
1111
#[command(subcommand)]
1212
pub cmd: Command,
1313
}
1414

1515
#[derive(Debug, Subcommand)]
1616
pub enum Command {
17+
/// Generate the starting docker-compose file
1718
Init {
1819
/// Path to config file
19-
#[arg(long("config"), default_value = CB_CONFIG_FILE)]
20+
#[arg(long("config"))]
2021
config_path: String,
2122

2223
/// Path to output files
2324
#[arg(short, long("output"), default_value = "./")]
2425
output_path: String,
2526
},
2627

28+
/// Start the Commit-Boost services
2729
Start {
2830
/// Path to docker compose file
2931
#[arg(
@@ -38,6 +40,7 @@ pub enum Command {
3840
env_path: Option<String>,
3941
},
4042

43+
/// Stop the Commit-Boost services
4144
Stop {
4245
/// Path to docker compose file
4346
#[arg(
@@ -52,6 +55,7 @@ pub enum Command {
5255
env_path: String,
5356
},
5457

58+
/// See stdout logs
5559
Logs {
5660
/// Path to docker compose file
5761
#[arg(
@@ -84,3 +88,5 @@ impl Args {
8488
}
8589
}
8690
}
91+
92+
const LONG_ABOUT: &str = "Commit-Boost allows Ethereum validators to safely run MEV-Boost and community-built commitment protocols";

crates/common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "cb-common"
33
version.workspace = true
44
edition.workspace = true
55
rust-version.workspace = true
6+
publish = false
67

78
[dependencies]
89
# ethereum

crates/common/src/config/constants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pub const SIGNER_DIR_SECRETS: &str = "/secrets";
2222
pub const JWTS_ENV: &str = "CB_JWTS";
2323

2424
// TODO: replace these with an actual image in the registry
25-
pub const PBS_DEFAULT_IMAGE: &str = "commitboost_pbs_default";
26-
pub const SIGNER_IMAGE: &str = "commitboost_signer";
25+
pub const PBS_DEFAULT_IMAGE: &str = "ghcr.io/commit-boost/pbs:latest";
26+
pub const SIGNER_IMAGE: &str = "ghcr.io/commit-boost/signer:latest";
2727

2828
// Module names
2929
pub const PBS_MODULE_NAME: &str = "pbs";

crates/metrics/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "cb-metrics"
33
version.workspace = true
44
rust-version.workspace = true
55
edition.workspace = true
6+
publish = false
67

78
[dependencies]
89
cb-common.workspace = true

crates/pbs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "cb-pbs"
33
version.workspace = true
44
edition.workspace = true
55
rust-version.workspace = true
6+
publish = false
67

78
[dependencies]
89
cb-common.workspace = true

0 commit comments

Comments
 (0)