-
Notifications
You must be signed in to change notification settings - Fork 13
110 lines (108 loc) · 4 KB
/
Copy pathmake-binary-macos.yml
File metadata and controls
110 lines (108 loc) · 4 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
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
name: Make binary (macOS)
on:
workflow_dispatch:
jobs:
make-binary-macos:
strategy:
matrix:
os: [macos-26-intel, macos-26]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Make falco dependency directories
run: sudo mkdir -p /opt/falco/lib /opt/falco/include
- name: Update Homebrew
run: brew untap aws/tap && brew update
- name: Install dependency headers and static libs
run: |
brew install zlib automake isa-l
sudo cp $(brew --prefix zlib)/lib/*.a /opt/falco/lib
sudo cp -r $(brew --prefix zlib)/include/* /opt/falco/include
sudo cp $(brew --prefix isa-l)/lib/*.a /opt/falco/lib
sudo cp -r $(brew --prefix isa-l)/include/* /opt/falco/include
- name: Build and install libdeflate
run: |
git clone https://github.com/ebiggers/libdeflate.git && \
cd libdeflate && \
cmake -B build \
-DLIBDEFLATE_BUILD_GZIP=off \
-DLIBDEFLATE_BUILD_TESTS=off \
-DLIBDEFLATE_BUILD_SHARED_LIB=off \
-DCMAKE_VERBOSE_MAKEFILE=on \
-DCMAKE_BUILD_TYPE=Release && \
cmake --build build -j4 && \
sudo cmake --install build --prefix=/opt/falco
- name: Build and install HTSlib
run: |
git clone --recursive https://github.com/samtools/htslib.git
cd htslib
sudo cp -r htslib /opt/falco/include
autoreconf -i
mkdir build && cd build
../configure \
--disable-bz2 \
--disable-libcurl \
--disable-lzma \
--disable-ref-cache \
--with-libdeflate \
LDFLAGS="-L/opt/falco/lib" CPPFLAGS="-I/opt/falco/include"
make -j4 CFLAGS="-Wall -O2 -fvisibility=hidden" libhts.a
sudo cp libhts.a /opt/falco/lib
- name: Build falco
run: |
cmake -B build -DPACKAGE=on \
-DCMAKE_VERBOSE_MAKEFILE=on \
-DCMAKE_CXX_COMPILER=g++-15 \
-DUSE_ISAL=on \
-DHTSLIB_ROOT=/opt/falco \
-DISAL_ROOT=/opt/falco \
-DLIBDEFLATE_ROOT=/opt/falco \
-DZLIB_ROOT=/opt/falco \
-DCMAKE_BUILD_TYPE=Release && \
cmake --build build -j4
- name: Rename the binary
run: mv build/falco falco_$(uname -m)
- name: Get version number
id: vars
run: |
awk '/^ VERSION [0-9.]+$/ {print "vn="$NF}' CMakeLists.txt >> "$GITHUB_OUTPUT"
uname -m | awk '{print "arch="$0}' >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Upload the binary
uses: actions/upload-artifact@v7
with:
name: falco-${{ steps.vars.outputs.arch }}
path: |
falco_${{ steps.vars.outputs.arch }}
make-lipo:
needs: make-binary-macos
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- name: Get version number
id: get-vn
run: |
awk '/^ VERSION [0-9.]+$/ {print "vn="$NF}' CMakeLists.txt >> "$GITHUB_OUTPUT"
git rev-parse --short "$GITHUB_SHA" | awk '{print "hash="$0}' >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: binaries
pattern: falco-*
merge-multiple: false
- name: Create universal binary
run: |
lipo -create \
binaries/falco-*/falco_* \
-output falco-${{ steps.get-vn.outputs.vn }}-${{ steps.get-vn.outputs.hash }}-macOS
chmod +x falco-${{ steps.get-vn.outputs.vn }}-${{ steps.get-vn.outputs.hash }}-macOS
- name: Upload the lipo binary
uses: actions/upload-artifact@v7
with:
name: falco-${{ steps.get-vn.outputs.vn }}-${{ steps.get-vn.outputs.hash }}-macOS
path: falco-${{ steps.get-vn.outputs.vn }}-${{ steps.get-vn.outputs.hash }}-macOS