-
Notifications
You must be signed in to change notification settings - Fork 90
79 lines (68 loc) · 2.22 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
name: Build Bacalhau Binaries
on:
workflow_call:
jobs:
build:
name: Build Binary
runs-on: ubuntu-latest
outputs:
status: ${{ job.status }}
strategy:
matrix:
include:
- os: linux
goarch: amd64
- os: linux
goarch: arm64
- os: linux
goarch: armv7
- os: linux
goarch: armv6
- os: darwin
goarch: amd64
- os: darwin
goarch: arm64
- os: windows
goarch: amd64
steps:
- name: Install earthly
uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: "0" # Need to fetch all due to how bacalhau constructs semver
- uses: actions/setup-go@v5
with:
go-version-file: go.work
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.goarch }}
PRIVATE_PEM: ${{ secrets.PRIVATE_PEM }}
PUBLIC_PEM: ${{ secrets.PUBLIC_PEM }}
PRIVATE_KEY_PASSPHRASE: ${{ secrets.PRIVATE_KEY_PASSPHRASE }}
run: |
# Add Keys to expected files
echo "${PRIVATE_PEM}" > /tmp/private.pem && chmod 600 /tmp/private.pem
echo "${PUBLIC_PEM}" > /tmp/public.pem && chmod 600 /tmp/public.pem
# Start build
echo "==> Building bacalhau binary for: ${GOOS} ${GOARCH}..."
make build-bacalhau-tgz
echo "===> Done building bacalhau binary."
# Listing Builds
echo "===> Built Artifacts:"
ls -lh dist/
# Remove keys, good security practice
rm /tmp/private.pem /tmp/public.pem
- name: Upload binary artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.goarch }}
path: "dist/bacalhau_*"
retention-days: 1 # Short retention since these are intermediate artifacts, also save money
- name: Report build status
if: always()
run: |
echo "Build completed for ${{ matrix.os }}-${{ matrix.goarch }}"
echo "Status: ${{ job.status }}"