-
Notifications
You must be signed in to change notification settings - Fork 15
96 lines (85 loc) · 3.46 KB
/
_20_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
on:
workflow_call:
inputs:
profile:
default: release
description: Profile to build
type: string
is-mainnet:
default: false
description: Whether to build for mainnet (currently just for verifying dylibs)
type: boolean
upload-name:
default: chainflip-backend-bin
description: Name of the folder to upload the binaries to
type: string
binary-subdir:
default: release
type: string
description: Subdirectory of the target folder to upload
env:
FORCE_COLOR: 1
COMMIT_HASH: ${{ github.sha }}
CF_MAINNET_GPG_KEY_ID: "4E506212E4EF4E0D3E37E568596FBDCACBBCDD37"
jobs:
compile:
runs-on: namespace-profile-rust-builder
container:
image: "ghcr.io/${{ github.repository }}/rust-base:nightly-2024-11-23"
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout 🛒
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
# This is a workaround for the issue with Git ownership that prevents cargo from executing git commands to get commit hash for `--version`
- name: Configure Git 🛠️
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Import GPG key from Ubuntu key server 🔑
if: inputs.is-mainnet
run: |
gpg --keyserver keyserver.ubuntu.com --recv-keys $CF_MAINNET_GPG_KEY_ID
gpg --list-keys
- name: Verify GPG key import ✅
if: inputs.is-mainnet
run: |
gpg --list-keys | grep -q "$CF_MAINNET_GPG_KEY_ID"
if [ $? -eq 0 ]; then
echo "GPG key successfully imported"
else
echo "Failed to import GPG key"
exit 1
fi
- name: Build chainflip binaries 🏗️
run: |
if [ "${{ inputs.is-mainnet }}" = "true" ]; then
export IS_MAINNET=true
fi
cargo cf-build-${{ inputs.profile }} --locked
- name: ls directory
run: |
ls -la ./target/${{ inputs.binary-subdir }}
# We flatten the structure so upload-artifact uploads a flattened structure
- name: Prepare binaries for upload
run: |
mkdir -p ./target/${{ inputs.binary-subdir }}
cp ./target/${{ inputs.binary-subdir }}/deps/libchainflip_engine_v*.so ./target/${{ inputs.binary-subdir }}/ || true
- name: Upload binary artifacts
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: ${{ inputs.upload-name }}
path: |
./target/${{ inputs.binary-subdir }}/chainflip-node
./target/${{ inputs.binary-subdir }}/chainflip-cli
./target/${{ inputs.binary-subdir }}/generate-genesis-keys
./target/${{ inputs.binary-subdir }}/chainflip-broker-api
./target/${{ inputs.binary-subdir }}/chainflip-lp-api
./target/${{ inputs.binary-subdir }}/chainflip-ingress-egress-tracker
./target/${{ inputs.binary-subdir }}/libchainflip_engine_v*.so
./target/${{ inputs.binary-subdir }}/engine-runner
- name: Upload runtime artifacts
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: chainflip-node-runtime-${{ inputs.profile }}
path: |
./target/${{ inputs.binary-subdir }}/wbuild/state-chain-runtime/state_chain_runtime*.wasm