-
Notifications
You must be signed in to change notification settings - Fork 56
156 lines (129 loc) · 5.53 KB
/
bridge.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
name: Bridge
on:
push:
tags:
- '*-bridge*'
env:
CARGO_TERM_COLOR: always
jobs:
#?####################################################################################################?#
#? ?#
#? Build Helper Images ?#
#? ?#
#?####################################################################################################?#
aarch64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building Docker Image
uses: ./.github/actions/build-helper
with:
imagename: aarch64-unknown-linux-gnu
x86_64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building Docker Image
uses: ./.github/actions/build-helper
with:
imagename: x86_64-unknown-linux-gnu
#?####################################################################################################?#
#? ?#
#? Build Releases ?#
#? ?#
#?####################################################################################################?#
Build_aarch64:
needs: [aarch64]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building aarch64 Binary
uses: ./.github/actions/build-bridge
with:
target: aarch64-unknown-linux-gnu
- name: see path
run: cd target && tree
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: aarch64-release
path: |
target/aarch64-unknown-linux-gnu/release/witnet-centralized-ethereum-bridge
Build_x86_64:
needs: [x86_64]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building x86_64 Binary
uses: ./.github/actions/build-bridge
with:
target: x86_64-unknown-linux-gnu
- name: see path
run: cd target && tree
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: x86_64-release
path: |
target/x86_64-unknown-linux-gnu/release/witnet-centralized-ethereum-bridge
#?####################################################################################################?#
#? ?#
#? Sign & Publish ?#
#? ?#
#?####################################################################################################?#
Publish:
needs: [Build_aarch64, Build_x86_64]
runs-on: ubuntu-latest
environment: tags
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Download aarch64 Build
uses: actions/download-artifact@v4
with:
name: aarch64-release
path: all-releases/aarch64/
- name: Download x86_64 Build
uses: actions/download-artifact@v4
with:
name: x86_64-release
path: all-releases/x86_64/
- name: Prepare aarch64
run: |
chmod +x ./all-releases/aarch64/witnet-centralized-ethereum-bridge
mv all-releases/aarch64/witnet-centralized-ethereum-bridge docker/bridge/witnet-centralized-ethereum-bridge-aarch64-unknown-linux-gnu
- name: Prepare x86_64
run: |
chmod +x ./all-releases/x86_64/witnet-centralized-ethereum-bridge
mv all-releases/x86_64/witnet-centralized-ethereum-bridge docker/bridge/witnet-centralized-ethereum-bridge-x86_64-unknown-linux-gnu
- name: List binaries
run: tree docker
- name: Build Base
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multiarch --driver docker-container --use
docker buildx inspect --bootstrap
# Build Docker images (Latest & TAG)
- name: Build TAG
run: |
PRUNED_TAG=$(echo "${{github.ref_name}}" | sed 's/-bridge//')
docker buildx build -f docker/bridge/Dockerfile --progress=plain --platform linux/amd64,linux/arm64 --tag witnet/witnet-centralized-ethereum-bridge:$PRUNED_TAG docker/bridge
- name: Check Pre-release
run: |
TAG=${{ github.ref_name }}
if [[ "$TAG" =~ -rc ]]; then
echo "prerelease=true" >> $GITHUB_ENV
else
echo "prerelease=false" >> $GITHUB_ENV
- name: Build Latest if not Pre-Release
if: env.prerelease == 'false'
run: docker buildx build -f docker/bridge/Dockerfile --progress=plain --platform linux/amd64,linux/arm64 --tag witnet/witnet-centralized-ethereum-bridge:latest docker/bridge --push --no-cache