Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create releases with binaries built on github actions #78

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Build binaries and DEB packages

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-debs:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: amd64
arch: amd64
platform: linux/amd64
- name: arm64
arch: arm64
platform: linux/arm64
# SDSL requires a 64 bit system. 32 bit system detected.
# - name: arm32
# arch: arm32
# platform: linux/arm/v7

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.staticbuild
platforms: ${{ matrix.platform }}
load: true
push: false
tags: tracy:local

- name: Get the version
id: get_version
run: |
echo "version=$(cat src/version.h | grep -Po '(?<=tracyVersionNumber = ")[^\"]+')" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT

- name: Extract binary from container
id: extract
run: |
docker create --name extract --platform ${{ matrix.platform }} tracy:local
docker cp extract:/opt/tracy/bin/tracy ./tracy-${{ matrix.arch }}-${{ steps.get_version.outputs.version }}
docker rm -v extract
echo "filename=tracy-${{ matrix.arch }}-${{ steps.get_version.outputs.version }}" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT

- name: Prepare DPKG files
run: |
mkdir -p .debpkg/usr/bin
cp ./${{ steps.extract.outputs.filename }} .debpkg/usr/bin/tracy
chmod +x .debpkg/usr/bin/tracy

- uses: jiro4989/build-deb-action@v2
id: build-deb
with:
package: tracy
package_root: .debpkg
maintainer: Tobias Rausch <[email protected]>
version: ${{ steps.get_version.outputs.version }}
arch: ${{ matrix.arch }}
depends: 'libc6 (>= 2.2.1)'
desc: 'Tracy: basecalling, alignment, assembly and deconvolution of Sanger Chromatogram trace files'

- name: Install Singularity
if: matrix.name == 'amd64'
uses: eWaterCycle/setup-singularity@master
with:
singularity-version: 3.8.7

- name: Build Singularity package
if: matrix.name == 'amd64'
run: |
singularity build --fakeroot tracy-${{ matrix.arch }}.sif singularity/tracy.def

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
if: steps.extract.outputs.status == 'success' && !cancelled()
with:
# Artifact name
name: tracy-${{ matrix.arch }}
# A file, directory or wildcard pattern that describes what to upload
path: |
./${{ steps.extract.outputs.filename }}
./*.deb
./tracy-${{ matrix.arch }}.sif
make-release:
needs: build-debs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get the version
id: get_version
run: |
echo "version=$(cat src/version.h | grep -Po '(?<=tracyVersionNumber = ")[^\"]+')" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT

- name: Download all assets
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Generate release tag
id: tag
if: github.ref == 'refs/heads/main' && !cancelled()
run: |
echo "release_tag=$(echo ${GITHUB_SHA::4})" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
artifacts/tracy-*/*
tag_name: ${{ steps.get_version.outputs.version }}
41 changes: 41 additions & 0 deletions Dockerfile.staticbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# use the ubuntu base image
FROM ubuntu:22.04

MAINTAINER Tobias Rausch [email protected]

# install packages
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
cmake \
g++ \
gfortran \
git \
libcurl4-gnutls-dev \
hdf5-tools \
libboost-date-time-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libbz2-dev \
libdeflate-dev \
libhdf5-dev \
libncurses-dev \
liblzma-dev \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# set environment
ENV BOOST_ROOT /usr

# install tracy
WORKDIR /opt/tracy/
ADD ./src/ /opt/tracy/src/
COPY .gitmodules Makefile /opt/tracy/
RUN make STATIC=1 all \
&& make install

# by default /bin/sh is executed
CMD ["/bin/sh"]