-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yaml
More file actions
73 lines (65 loc) · 2.91 KB
/
Copy pathaction.yaml
File metadata and controls
73 lines (65 loc) · 2.91 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
# Copyright (c) 2025 Erick Bourgeois, finos
# SPDX-License-Identifier: Apache-2.0
name: 'Prepare Docker Binaries'
description: 'Downloads artifacts and prepares binaries for multi-arch Docker build'
runs:
using: composite
steps:
- name: Download all binary artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: ./artifacts
pattern: 5spot-linux-*
- name: Prepare binaries for Docker build
shell: bash
run: |
mkdir -p binaries/amd64 binaries/arm64
# Debug: Show what was downloaded
echo "Downloaded artifacts:"
find artifacts/ -type f -name "5spot" -o -name "*.cdx.*"
# Copy x86_64 binary
AMD64_BINARY=$(find artifacts/5spot-linux-amd64 -type f -name "5spot" | head -1)
if [ -n "$AMD64_BINARY" ] && [ -f "$AMD64_BINARY" ]; then
cp "$AMD64_BINARY" binaries/amd64/5spot
chmod +x binaries/amd64/5spot
echo "Copied x86_64 binary from $AMD64_BINARY"
else
echo "ERROR: x86_64 binary not found"
echo "Contents of artifacts/5spot-linux-amd64:"
find artifacts/5spot-linux-amd64 -ls || echo "Directory does not exist"
exit 1
fi
# Copy ARM64 binary
ARM64_BINARY=$(find artifacts/5spot-linux-arm64 -type f -name "5spot" | head -1)
if [ -n "$ARM64_BINARY" ] && [ -f "$ARM64_BINARY" ]; then
cp "$ARM64_BINARY" binaries/arm64/5spot
chmod +x binaries/arm64/5spot
echo "Copied ARM64 binary from $ARM64_BINARY"
else
echo "ERROR: ARM64 binary not found"
echo "Contents of artifacts/5spot-linux-arm64:"
find artifacts/5spot-linux-arm64 -ls || echo "Directory does not exist"
exit 1
fi
# Copy the spot-schedule provider binaries. The main image is multi-binary —
# the provider Deployments select them via `command:` — so the Dockerfile
# COPYs them alongside /5spot. Without this they are absent from the artifacts
# and the build fails ("binaries/<arch>/spot-schedule-time-based: not found").
for arch_dir in amd64 arm64; do
art="artifacts/5spot-linux-$arch_dir"
for prov in spot-schedule-time-based spot-schedule-capital-markets; do
PROV_BIN=$(find "$art" -type f -name "$prov" | head -1)
if [ -n "$PROV_BIN" ] && [ -f "$PROV_BIN" ]; then
cp "$PROV_BIN" "binaries/$arch_dir/$prov"
chmod +x "binaries/$arch_dir/$prov"
echo "Copied $prov ($arch_dir) from $PROV_BIN"
else
echo "ERROR: $prov ($arch_dir) not found in $art"
find "$art" -ls || echo "Directory does not exist"
exit 1
fi
done
done
# Verify binaries
ls -lh binaries/amd64/* binaries/arm64/*
file binaries/amd64/5spot binaries/arm64/5spot