Skip to content

DNMTools release (macOS) #7

DNMTools release (macOS)

DNMTools release (macOS) #7

name: DNMTools release (macOS)
on:
workflow_dispatch:
jobs:
build-macos-binaries:
strategy:
matrix:
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Make dnmtools dependency directories
run: sudo mkdir -p /opt/dnmtools/lib /opt/dnmtools/include
- name: Install dependency headers and static libs
run: |
brew install zlib gsl automake
sudo cp $(brew --prefix zlib)/lib/*.a /opt/dnmtools/lib
sudo cp $(brew --prefix gsl)/lib/*.a /opt/dnmtools/lib
sudo cp -r $(brew --prefix zlib)/include/* /opt/dnmtools/include
sudo cp -r $(brew --prefix gsl)/include/* /opt/dnmtools/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/dnmtools
- name: Build and install HTSlib
run: |
git clone --recursive https://github.com/samtools/htslib.git
cd htslib
sudo cp -r htslib /opt/dnmtools/include
autoreconf -i
mkdir build && cd build
../configure \
--disable-bz2 \
--disable-libcurl \
--disable-lzma \
--disable-ref-cache \
--with-libdeflate \
LDFLAGS="-L/opt/dnmtools/lib" CPPFLAGS="-I/opt/dnmtools/include"
make -j4 CFLAGS="-Wall -O2 -fvisibility=hidden" libhts.a
sudo cp libhts.a /opt/dnmtools/lib
- name: Build dnmtools
run: |
./autogen.sh
mkdir build && cd build
../configure --with-libdeflate \
CXX=g++-14 \
LDFLAGS="-L/opt/dnmtools/lib -static-libgcc -static-libstdc++ -Wl,-dead_strip" \
CPPFLAGS="-I/opt/dnmtools/include"
make -j4
- name: Rename the binary
run: mv build/dnmtools dnmtools_$(uname -m)
- name: Get version number
id: vars
run: |
awk '/AC_INIT/ {print "vn="$2}' configure.ac | \
sed "s/\[//; s/\]//; s/,//" >> "$GITHUB_OUTPUT"
uname -m | awk '{print "arch="$0}' >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Upload the binary
uses: actions/upload-artifact@v4
with:
name: dnmtools-${{ steps.vars.outputs.arch }}
path: |
dnmtools_${{ steps.vars.outputs.arch }}
make-lipo:
needs: build-macos-binaries
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: binaries
pattern: dnmtools-*
merge-multiple: false
- name: Create universal binary
run: |
lipo -create \
binaries/dnmtools-*/dnmtools_* \
-output dnmtools
chmod +x dnmtools
- name: Get version number
id: vn
run: awk '/AC_INIT/ {print "vn="$2}' configure.ac | sed "s/\[//; s/\]//; s/,//" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Upload the lipo binary
uses: actions/upload-artifact@v4
with:
name: dnmtools-${{ steps.vn.outputs.vn }}-macOS
path: dnmtools