@@ -22,29 +22,45 @@ jobs:
2222 - ubuntu-22.04
2323 - ubuntu-24.04-arm
2424 - macos-latest
25- gpu :
26- - true
27- - false
25+ stack :
26+ - l1
27+ - l2
28+ - l2_gpu
29+ exclude :
30+ - platform : macos-latest
31+ stack : l2_gpu
2832 include :
2933 - platform : ubuntu-22.04
3034 os : linux
3135 arch : x86_64
32- prover_features : sp1,risc0
3336 cpu_flags : RUSTFLAGS='-C target-cpu=x86-64-v2'
3437 - platform : ubuntu-24.04-arm
3538 os : linux
3639 arch : aarch64
37- prover_features : sp1
3840 - platform : macos-latest
3941 os : macos
4042 arch : aarch64
41- - gpu : true
43+ - platform : macos-latest
44+ stack : l2
45+ features : l2,l2-sql
46+ - platform : ubuntu-22.04
47+ stack : l2
48+ features : l2,l2-sql,sp1,risc0
49+ - platform : ubuntu-22.04
50+ stack : l2_gpu
51+ features : l2,l2-sql,sp1,risc0,gpu
52+ - platform : ubuntu-24.04-arm
53+ stack : l2
54+ features : l2,l2-sql,sp1
55+ - platform : ubuntu-24.04-arm
56+ stack : l2_gpu
57+ features : l2,l2-sql,sp1,gpu
58+ - stack : l2_gpu
4259 gpu_flags : NVCC_PREPEND_FLAGS='-arch=sm_70'
43- gpu_feature : " ,gpu "
60+ l2_suffix : " -l2 "
4461 gpu_suffix : " -gpu"
45- exclude :
46- - platform : macos-latest
47- gpu : true
62+ - stack : l2
63+ l2_suffix : " -l2"
4864 runs-on : ${{ matrix.platform }}
4965 steps :
5066 - name : Free Disk Space (Ubuntu)
5773 - name : Checkout code
5874 uses : actions/checkout@v4
5975
60- - name : Rustup toolchain install
61- uses : dtolnay/rust-toolchain@master
62- with :
63- toolchain : ${{ vars.RUST_VERSION }}
76+ - name : Setup Rust Environment
77+ uses : ./.github/actions/setup-rust
6478
6579 - name : Install SP1 (only Linux)
6680 if : ${{ matrix.os == 'linux' }}
89103
90104 - name : Install CUDA (only Linux x86 GPU)
9110592- if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.gpu }}
106+ if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }}
93107 id : cuda-toolkit
94108 with :
95109 cuda : " 12.9.0"
@@ -116,11 +130,12 @@ jobs:
116130
117131 - name : Build ethrex
118132 run : |
119- COMPILE_CONTRACTS=true ${{ matrix.cpu_flags }} ${{ matrix.gpu_flags }} cargo build --release --features "${{ matrix.prover_features }}${{ matrix.gpu_feature }}" --bin ethrex
120- mv target/release/ethrex ethrex-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.gpu_suffix }}
133+ COMPILE_CONTRACTS=true ${{ matrix.cpu_flags }} ${{ matrix.gpu_flags }} cargo build --release --features "${{ matrix.features }}" --bin ethrex
134+ chmod +x target/release/ethrex
135+ mv target/release/ethrex ethrex${{ matrix.l2_suffix }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.gpu_suffix }}
121136
122137 - name : Copy verification keys
123- if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.gpu }} # Run only once
138+ if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }} # Run only once
124139 run : |
125140 mkdir -p ./verification_keys
126141 mv crates/l2/prover/src/guest_program/src/risc0/out/riscv32im-risc0-vk verification_keys/ethrex-riscv32im-risc0-vk
@@ -129,11 +144,11 @@ jobs:
129144 - name : Upload artifact
130145 uses : actions/upload-artifact@v4
131146 with :
132- name : ethrex-${{ matrix.os }}_ ${{ matrix.arch }}${{ matrix.gpu_suffix }}
133- path : ethrex-${{ matrix.os }}_ ${{ matrix.arch }}${{ matrix.gpu_suffix }}
147+ name : ethrex${{ matrix.l2_suffix }} -${{ matrix.os }}- ${{ matrix.arch }}${{ matrix.gpu_suffix }}
148+ path : ethrex${{ matrix.l2_suffix }} -${{ matrix.os }}- ${{ matrix.arch }}${{ matrix.gpu_suffix }}
134149
135150 - name : Upload verification keys
136- if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.gpu }} # Run only once
151+ if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }} # Run only once
137152 uses : actions/upload-artifact@v4
138153 with :
139154 name : verification_keys
@@ -183,8 +198,8 @@ jobs:
183198 run : echo "TAG_VERSION=$(echo ${{ github.ref_name }} | tr -d v)" >> $GITHUB_ENV
184199
185200 # Pushes to ghcr.io/lambdaclass/ethrex
186- - name : Build and push Docker image
187- id : push
201+ - name : Build and push L1 Docker image
202+ id : push_l1
188203 uses : ./.github/actions/build-docker
189204 with :
190205 registry : ${{ env.REGISTRY }}
@@ -193,7 +208,19 @@ jobs:
193208 push : true
194209 tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_VERSION }}
195210
196- # Creates a draft release on GitHub with the binaries
211+ # Pushes to ghcr.io/lambdaclass/ethrex
212+ - name : Build and push L2 Docker image
213+ id : push_l2
214+ uses : ./.github/actions/build-docker
215+ with :
216+ registry : ${{ env.REGISTRY }}
217+ username : ${{ github.actor }}
218+ password : ${{ secrets.GITHUB_TOKEN }}
219+ push : true
220+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-l2,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_VERSION }}-l2
221+ build_args : BUILD_FLAGS=--features l2,l2-sql
222+
223+ # Creates a release on GitHub with the binaries
197224 finalize-release :
198225 needs :
199226 - build-ethrex
@@ -218,6 +245,9 @@ jobs:
218245 echo "PREVIOUS_TAG: $name"
219246 echo "PREVIOUS_TAG=$name" >> $GITHUB_ENV
220247
248+ - name : Check release type
249+ run : echo "TAG_SUFFIX=$(echo ${{ github.ref_name }}- | cut -d- -f2)" >> $GITHUB_ENV
250+
221251 - name : Update CHANGELOG
222252 id : changelog
223253 uses : requarks/changelog-action@v1
@@ -233,8 +263,8 @@ jobs:
233263 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
234264 with :
235265 files : ./bin/**/*
236- draft : false
237- prerelease : false
266+ draft : ${{ startsWith(env.TAG_SUFFIX, 'rc') }}
267+ prerelease : ${{ startsWith(env.TAG_SUFFIX, 'rc') }}
238268 tag_name : ${{ github.ref_name }}
239269 name : " ethrex: ${{ github.ref_name }}"
240270 body : >
0 commit comments