-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add release pipeline: builds, verifies BITCOIN_DA_ID, releases binary (…
…#1000) * add release pipeline: builds, verifies BITCOIN_DA_ID, releases citrea binary * add Dockerfile * env EXPECTED_DATA to EXPECTED_BITCOIN_DA_ID * add osx_arm64 release * remove dockerfile
- Loading branch information
Showing
1 changed file
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
env: | ||
EXPECTED_BITCOIN_DA_ID: ${{ vars.EXPECTED_BITCOIN_DA_ID }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
|
||
x86_64_binary_extraction: | ||
runs-on: ubicloud-standard-30 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt update && sudo apt -y install curl gcc cpp cmake clang llvm | ||
sudo apt -y autoremove && sudo apt clean && sudo rm -rf /var/lib/apt/lists/* | ||
- name: Install Rust | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
- name: Install Cargo Binstall | ||
run: | | ||
source $HOME/.cargo/env | ||
cargo install cargo-binstall | ||
- name: Install Cargo Risczero | ||
run: | | ||
cargo binstall -y cargo-risczero | ||
cargo risczero install --version v2024-04-22.0 | ||
- name: Build Project | ||
env: | ||
REPR_GUEST_BUILD: 1 | ||
run: | | ||
cargo build --release | ||
- name: Check BITCOIN_DA_ID | ||
id: check-id | ||
run: | | ||
RESULT=$(grep -R "BITCOIN_DA_ID" target/ || echo "Grep failed") | ||
if echo "$RESULT" | grep -q "${{ env.EXPECTED_BITCOIN_DA_ID }}"; then | ||
echo "Check passed successfully." | ||
else | ||
echo "Check failed. Expected: BITCOIN_DA_ID ${{ env.EXPECTED_BITCOIN_DA_ID }} " | ||
echo "Actual: $RESULT" | ||
exit 1 | ||
fi | ||
- name: Upload x86_64 Binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: citrea_${{ github.ref_name }}_x86_64 | ||
path: target/release/citrea | ||
|
||
osx_arm64_binary_extraction: | ||
runs-on: self-hosted-citrea-osx-arm64 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
- name: Install Cargo Binstall | ||
run: | | ||
source $HOME/.cargo/env | ||
cargo install cargo-binstall | ||
- name: Install Cargo Risczero | ||
run: | | ||
source $HOME/.cargo/env | ||
cargo binstall -y cargo-risczero | ||
cargo risczero install --version v2024-04-22.0 | ||
- name: Build Project | ||
env: | ||
REPR_GUEST_BUILD: 1 | ||
run: | | ||
source $HOME/.cargo/env | ||
cargo build --release | ||
- name: Check BITCOIN_DA_ID | ||
id: check-id | ||
run: | | ||
RESULT=$(grep -R "BITCOIN_DA_ID" target/ || echo "Grep failed") | ||
if echo "$RESULT" | grep -q "${{ env.EXPECTED_BITCOIN_DA_ID }}"; then | ||
echo "Check passed successfully." | ||
else | ||
echo "Check failed. Expected: BITCOIN_DA_ID ${{ env.EXPECTED_BITCOIN_DA_ID }} " | ||
echo "Actual: $RESULT" | ||
exit 1 | ||
fi | ||
- name: Upload osx_arm64 Binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: citrea_${{ github.ref_name }}_osx_arm64 | ||
path: target/release/citrea | ||
|
||
release: | ||
needs: [ x86_64_binary_extraction, osx_arm64_binary_extraction ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download x86_64 Binary | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: citrea_${{ github.ref_name }}_x86_64 | ||
path: release | ||
|
||
- name: rename file | ||
run: | | ||
mv release/citrea release/citrea_${{ github.ref_name }}_x86_64 | ||
- name: Download OSX ARM64 Binary | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: citrea_${{ github.ref_name }}_osx_arm64 | ||
path: release | ||
|
||
- name: rename file | ||
run: | | ||
mv release/citrea release/citrea_${{ github.ref_name }}_osx_arm64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
release/citrea_${{ github.ref_name }}_osx_arm64 | ||
release/citrea_${{ github.ref_name }}_x86_64 | ||
name: Release ${{ github.ref_name }} | ||
body: | | ||
This is the release for version ${{ github.ref_name }}. | ||
It includes: | ||
- citrea_${{ github.ref_name }}_x86_64 | ||
- citrea_${{ github.ref_name }}_osx_arm64 |