Repository navigation
Expand file tree
/
Copy pathdocker-proof-builder-rpc-regtest.yml
More file actions
77 lines (61 loc) · 2.4 KB
/
Copy pathdocker-proof-builder-rpc-regtest.yml
File metadata and controls
77 lines (61 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build and Push Docker Image
on:
push:
branches: [ main, dev ] # or your deployment branch
workflow_dispatch: # allow manual trigger
env:
IMAGE_REPO: ${{ github.repository }}
jobs:
build-and-push-proof-builder-rpc:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # needed for GitHub Container Registry
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install Rust
uses: actions-rs/toolchain@v1
timeout-minutes: 30
with:
toolchain: nightly
override: true
- name: "node-cleanup"
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
- name: Install Ziren toolchain
run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh
- name: Install Dependencies
run: sudo apt install protobuf-compiler -y
- name: Build binarys
run: export BITCOIN_NETWORK=regtest && source ~/.zkm-toolchain/env && cd proof-builder-rpc && cargo build --release
- name: Generate certs
run: cd circuits/tool && ./certgen.sh
- name: Extract version from Cargo.toml
id: version
run: |
VERSION=$(grep '^version =' ./Cargo.toml | head -n1 | sed -E 's/version = "(.*)"/\1/')
echo "CARGO_VERSION=$VERSION" >> $GITHUB_ENV
echo "Using version: $VERSION"
- name: Set lowercase repo name
id: lowercase
run: echo "REPO_LOWER=$(echo '${{ env.IMAGE_REPO }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry (ghcr.io)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image (proof-builder-rpc)
uses: docker/build-push-action@v5
with:
context: .
file: ./proof-builder-rpc/Dockerfile
push: true
tags: |
ghcr.io/${{ env.REPO_LOWER }}-proof-builder-rpc:latest
ghcr.io/${{ env.REPO_LOWER }}-proof-builder-rpc:${{ env.CARGO_VERSION }}