-
Notifications
You must be signed in to change notification settings - Fork 37
170 lines (143 loc) Β· 4.9 KB
/
release.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: release
on:
push:
tags:
- "v*.*.*"
jobs:
linux_amd64_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
rustup install 1.81.0
rustup default 1.81.0
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Project
env:
SKIP_GUEST_BUILD: 1
run: |
cargo build --release
- name: Check BATCH_PROOF_BITCOIN_ID
id: check-id
uses: ./.github/actions/validate-bitcoin-da
with:
expected_da_id: ${{ vars.EXPECTED_BITCOIN_DA_ID }}
action: check_binary
- name: Upload linux-amd64 Binary
uses: actions/upload-artifact@v4
with:
name: citrea-${{ github.ref_name }}-linux-amd64
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
rustup install 1.81.0
rustup default 1.81.0
- name: Install risc0
uses: ./.github/actions/install-risc0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Project
env:
SKIP_GUEST_BUILD: 1
run: |
source $HOME/.cargo/env
cargo build --release
- name: Check BATCH_PROOF_BITCOIN_ID
id: check-id
uses: ./.github/actions/validate-bitcoin-da
with:
expected_da_id: ${{ vars.EXPECTED_BITCOIN_DA_ID }}
action: check_binary
- name: Upload osx-arm64 Binary
uses: actions/upload-artifact@v4
with:
name: citrea-${{ github.ref_name }}-osx-arm64
path: target/release/citrea
release:
needs: [ linux_amd64_binary_extraction, osx_arm64_binary_extraction ]
runs-on: ubuntu-latest
steps:
- name: Download linux-amd64 Binary
uses: actions/download-artifact@v4
with:
name: citrea-${{ github.ref_name }}-linux-amd64
path: release
- name: rename file
run: |
mv release/citrea release/citrea-${{ github.ref_name }}-linux-amd64
- 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 }}-linux-amd64
name: Release ${{ github.ref_name }}
body: |
This is the release for version ${{ github.ref_name }}.
It includes:
- citrea-${{ github.ref_name }}-linux-amd64
- citrea-${{ github.ref_name }}-osx-arm64
update-public-fullnode:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download linux-amd64 Binary
uses: actions/download-artifact@v4
with:
name: citrea-${{ github.ref_name }}-linux-amd64
path: .
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Rename binary and Move required resources
run: |
mv citrea-${{ github.ref_name }}-linux-amd64 docker/build-push/nightly/citrea
chmod +x docker/build-push/nightly/citrea
mkdir -p docker/build-push/nightly/genesis/
mv resources/genesis/testnet/ docker/build-push/nightly/genesis/
- name: Build and push Linux image
uses: docker/build-push-action@v5
env:
DOCKERHUB_REPOSITORY: citrea-fullnode
IMAGE_TAG: testnet
with:
context: .
file: docker/build-push/nightly/Dockerfile
platforms: linux/amd64
push: true
load: false
provenance: false
tags: |
${{ vars.DOCKER_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:${{ env.IMAGE_TAG }}