-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
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: 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 | ||
if-no-files-found: error | ||
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-*/* | ||
prerelease: true | ||
tag_name: ${{ steps.get_version.outputs.version }}-${{ steps.tag.outputs.release_tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |