-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (146 loc) · 6.33 KB
/
build.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
name: Build and publish Mina lightweight network Docker images
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch: {}
jobs:
build-and-publish-amd64:
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
- name: Install and cache Hetzner Cloud CLI
uses: 3bit/setup-hcloud@v2
- name: Create mina-build-system-amd64 cloud VM
run: hcloud server create --name mina-build-system-amd64 --datacenter fsn1-dc14 --primary-ipv4 35577977 --image 153392983 --type cpx41 --ssh-key app@localhost --start-after-create
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 120 seconds
run: sleep 120s
shell: bash
- name: Update remote repositories
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_AMD64_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/git-pull-all.sh"
command_timeout: 10m
- name: Build and publish Docker images (major branches)
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_AMD64_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/o1labs/mina-lightnet-docker/scripts/build-all.sh amd64 ${HOME}/projects/o1labs/mina ${HOME}/projects/o1labs/Archive-Node-API ${HOME}/projects/o1labs/mina-lightnet-docker \"v0.1.1\" o1labs \"develop compatible master\""
command_timeout: 300m
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Power off the VM
run: hcloud server poweroff mina-build-system-amd64
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Delete the VM
run: hcloud server delete mina-build-system-amd64
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
build-and-publish-arm64:
needs: [build-and-publish-amd64] # Make jobs run sequentially to avoid possible cloud provider issues
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
- name: Install and cache Hetzner Cloud CLI
uses: 3bit/setup-hcloud@v2
- name: Create mina-build-system-arm64 cloud VM
run: hcloud server create --name mina-build-system-arm64 --datacenter fsn1-dc14 --primary-ipv4 45241536 --image 153393088 --type cax31 --ssh-key app@localhost --start-after-create
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 120 seconds
run: sleep 120s
shell: bash
- name: Update remote repositories
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_ARM64_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/git-pull-all.sh"
command_timeout: 10m
- name: Build and publish Docker images (major branches)
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_ARM64_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/o1labs/mina-lightnet-docker/scripts/build-all.sh arm64 ${HOME}/projects/o1labs/mina ${HOME}/projects/o1labs/Archive-Node-API ${HOME}/projects/o1labs/mina-lightnet-docker \"v0.1.1\" o1labs \"develop compatible master\""
command_timeout: 300m
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Power off the VM
run: hcloud server poweroff mina-build-system-arm64
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Delete the VM
run: hcloud server delete mina-build-system-arm64
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
create-and-publish-manifests:
needs: [build-and-publish-amd64, build-and-publish-arm64]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Install and cache Hetzner Cloud CLI
uses: 3bit/setup-hcloud@v2
- name: Create mina-build-system-arm64 cloud VM
run: hcloud server create --name mina-build-system-arm64 --datacenter fsn1-dc14 --primary-ipv4 45241536 --image 153393088 --type cax31 --ssh-key app@localhost --start-after-create
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 120 seconds
run: sleep 120s
shell: bash
- name: Update remote repositories
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_ARM64_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/git-pull-all.sh"
command_timeout: 10m
- name: Create, annotate and publish Docker images manifests
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_ARM64_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/o1labs/mina-lightnet-docker/scripts/manage-manifests.sh o1labs \"develop compatible master\""
command_timeout: 60m
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Power off the VM
run: hcloud server poweroff mina-build-system-arm64
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Delete the VM
run: hcloud server delete mina-build-system-arm64
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash