From a15ba6373ec5e6cfd0b22e7a907e64deb2a8de73 Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Thu, 12 Jun 2025 19:28:46 -0700 Subject: [PATCH 1/5] .github/workflows/dnmtools_release_linux.yml: adding a workflow to build linux binaries for releases --- .github/workflows/dnmtools_release_linux.yml | 58 ++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/dnmtools_release_linux.yml diff --git a/.github/workflows/dnmtools_release_linux.yml b/.github/workflows/dnmtools_release_linux.yml new file mode 100644 index 00000000..147667bd --- /dev/null +++ b/.github/workflows/dnmtools_release_linux.yml @@ -0,0 +1,58 @@ +name: dnmtools Release (Linux) + +on: + workflow_dispatch: + +env: + CONTAINER: andrewdavidsmith/transferase-build + +jobs: + linux-releases: + runs-on: ubuntu-latest + steps: + - name: Start docker container + # Pull the container, run it in detached mode, mount the workspace + run: | + docker pull $CONTAINER + docker run --name build-container \ + -d -v ${{ github.workspace }}:/workspace $CONTAINER tail -f /dev/null + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Configure and build + env: + SCRIPT: | + export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && apt-get install --no-install-recommends -y automake && \ + find /usr -name libz.so -exec rm {} \; && \ + git clone --recursive https://github.com/samtools/htslib.git && \ + cd htslib && \ + autoreconf -i && \ + mkdir build && cd build && \ + ../configure \ + --disable-bz2 \ + --disable-libcurl \ + --disable-lzma \ + --disable-ref-cache \ + LDADD="-L/usr/local/lib" && \ + make CFLAGS="-Wall -O2 -fvisibility=hidden" libhts.a && \ + cp libhts.a /usr/local/lib/ && \ + cp -r ../htslib /usr/local/include/ && \ + cd /workspace && \ + autoreconf -i && \ + mkdir build && cd build && \ + ../configure && \ + make -j4 LDFLAGS="-static-libgcc -static-libstdc++ -s" + run: | + docker exec build-container bash -c "$SCRIPT" + - name: Get version number + id: get-vn + run: | + awk '/AC_INIT/ {print "vn="$2}' configure.ac | sed -e "s/\[//; s/\]//; s/,//" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + - name: Upload the binary + uses: actions/upload-artifact@v4 + with: + name: dnmtools-${{ steps.get-vn.outputs.vn }}-Linux + path: build/dnmtools From 4b45d8a93020277b43e1d541f2467a0c04ffe818 Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Thu, 12 Jun 2025 19:32:02 -0700 Subject: [PATCH 2/5] .github/workflows/dnmtools_release_macos.yml: adding a workflow to build macos binaries for releases --- .github/workflows/dnmtools_release_macos.yml | 89 ++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/dnmtools_release_macos.yml diff --git a/.github/workflows/dnmtools_release_macos.yml b/.github/workflows/dnmtools_release_macos.yml new file mode 100644 index 00000000..3257f3d1 --- /dev/null +++ b/.github/workflows/dnmtools_release_macos.yml @@ -0,0 +1,89 @@ +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 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 \ + --without-libdeflate \ + LDADD="-L/usr/local/lib" + make 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 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 From 36898ee00f25a0d181d8acef092fd51008ef1dfd Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Thu, 12 Jun 2025 19:35:24 -0700 Subject: [PATCH 3/5] .github/workflows/ubuntu-builds.yml: separating gcc and clang builds into two jobs --- .github/workflows/ubuntu-builds.yml | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ubuntu-builds.yml b/.github/workflows/ubuntu-builds.yml index 825fa995..45adedc5 100644 --- a/.github/workflows/ubuntu-builds.yml +++ b/.github/workflows/ubuntu-builds.yml @@ -1,10 +1,14 @@ -name: DNMTools builds on Ubuntu +name: DNMTools build (Ubuntu) on: workflow_dispatch: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] jobs: - build: + build-with-gcc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -14,21 +18,25 @@ jobs: run: sudo apt-get install -y libhts-dev libgsl-dev - name: Generate configure script run: ./autogen.sh - - name: Configure for g++ + - name: Configure for GCC run: ./configure CXX="g++" - name: Build with g++ - run: make + run: make -j4 - name: Test the g++ build - run: make check-TESTS - - name: Cleanup after the g++ build - run: make distclean - - name: Install Clang/LLVM dependencies - run: sudo apt-get install -y libomp-dev - - name: Configure for clang++ + run: make -j4 check-TESTS + build-with-clang: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install dependencies + run: sudo apt-get install -y libhts-dev libgsl-dev + - name: Generate configure script + run: ./autogen.sh + - name: Configure for Clang run: ./configure CXX="clang++" - name: Build with clang++ - run: make + run: make -j4 - name: Test the clang++ build - run: make - - name: Cleanup after the clang++ build - run: make distclean + run: make -j4 check-TESTS From 72a021b88c1074db86269c3ca358821e9ed8fe14 Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Thu, 12 Jun 2025 19:35:45 -0700 Subject: [PATCH 4/5] .github/workflows/ubuntu-distcheck.yml: updates --- .github/workflows/ubuntu-distcheck.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ubuntu-distcheck.yml b/.github/workflows/ubuntu-distcheck.yml index 63103318..a7da112b 100644 --- a/.github/workflows/ubuntu-distcheck.yml +++ b/.github/workflows/ubuntu-distcheck.yml @@ -1,4 +1,4 @@ -name: DNMTools distribution check on Ubuntu +name: DNMTools distcheck (Ubuntu) on: workflow_dispatch: @@ -9,11 +9,9 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Update packages @@ -25,4 +23,4 @@ jobs: - name: configure run: ./configure - name: make distcheck - run: make distcheck + run: make -j4 distcheck From 35e9fa0048771348fb44053076d43a805d5c99fa Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Thu, 12 Jun 2025 19:37:55 -0700 Subject: [PATCH 5/5] .github/workflows/macos-builds.yml: adding separate build tests for x86 and arm64 --- .github/workflows/macos-builds.yml | 38 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos-builds.yml b/.github/workflows/macos-builds.yml index 8eddee4d..a75541cf 100644 --- a/.github/workflows/macos-builds.yml +++ b/.github/workflows/macos-builds.yml @@ -1,26 +1,46 @@ -name: DNMTools builds on macOS +name: DNMTools build (macOS) on: workflow_dispatch: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] jobs: - build: - + build-on-x86: runs-on: macos-13 - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Update Homebrew + run: brew update + - name: Install autotools + run: brew install automake + - name: Install dependencies + run: brew install htslib gsl + - name: Generate configure script + run: ./autogen.sh + - name: configure with g++-14 + run: ./configure CXX="g++-14" CPPFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" + - name: make + run: make -j4 + build-on-arm64: + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 with: submodules: recursive - name: Update Homebrew run: brew update - name: Install autotools - run: brew install autoconf automake libtool + run: brew install automake - name: Install dependencies run: brew install htslib gsl - name: Generate configure script run: ./autogen.sh - - name: configure with g++-12 - run: ./configure CXX="g++-12" CPPFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" + - name: configure with g++-14 + run: ./configure CXX="g++-14" CPPFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" - name: make - run: make + run: make -j4