Skip to content

Commit 4c25263

Browse files
authored
Merge pull request #198 from wtsi-npg/devel
Merge from devel to create release 0.17.1
2 parents 4067fc1 + e0facbb commit 4c25263

File tree

4 files changed

+204
-0
lines changed

4 files changed

+204
-0
lines changed

.github/workflows/create-release.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Create release"
2+
3+
on:
4+
push:
5+
tags:
6+
- "**"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
shell: bash -l -e -o pipefail {0}
14+
env:
15+
IMAGE_NAME: bambi
16+
REPOSITORY_OWNER: ${{ github.repository_owner }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: "Fetch Tags"
25+
# Workaround for https://github.com/actions/checkout/issues/290
26+
run: git fetch --tags --force
27+
28+
- name: "Get release variables"
29+
# RELEASE_VERSION assignment must match the command used in autoconf's
30+
# configure.ac file. On update, care should be taken to maintain both
31+
# sides congruent.
32+
run: |
33+
echo 'RELEASE_VERSION='$(git describe --always --tags --dirty) >> $GITHUB_ENV
34+
echo 'GIT_URL='$(git remote get-url origin) >> $GITHUB_ENV
35+
echo 'GIT_COMMIT='$(git log --pretty=format:'%H' -n 1) >> $GITHUB_ENV
36+
37+
- name: "Login to Docker registry"
38+
uses: docker/login-action@v2
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.repository_owner }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: "Build Docker image"
45+
run: |
46+
set -x
47+
docker build --rm \
48+
--file docker/Dockerfile \
49+
--build-arg HTSLIB_BRANCH=1.18 \
50+
--platform linux/amd64 \
51+
--progress plain \
52+
--load \
53+
--label "org.opencontainers.image.title=bambi" \
54+
--label "org.opencontainers.image.source=${GIT_URL}" \
55+
--label "org.opencontainers.image.revision=${GIT_COMMIT}" \
56+
--label "org.opencontainers.image.version=${RELEASE_VERSION}" \
57+
--label "org.opencontainers.image.created=$(date --utc --iso-8601=seconds)" \
58+
--tag "ghcr.io/$REPOSITORY_OWNER/${IMAGE_NAME}:${RELEASE_VERSION}" \
59+
--tag "ghcr.io/$REPOSITORY_OWNER/${IMAGE_NAME}:latest" \
60+
.
61+
62+
- name: "Push image to registry"
63+
run: |
64+
docker push "ghcr.io/$REPOSITORY_OWNER/$IMAGE_NAME:$RELEASE_VERSION"
65+
docker push "ghcr.io/$REPOSITORY_OWNER/$IMAGE_NAME:latest"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Lint and test-build Dockerfile"
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
lint-docker:
10+
runs-on: ubuntu-latest
11+
12+
continue-on-error: true
13+
14+
defaults:
15+
run:
16+
shell: "bash -l -e -o pipefail {0}"
17+
18+
steps:
19+
- name: "Checkout code"
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: "Lint Dockerfile"
25+
run: |
26+
cat <<EOT >> .hadolint.yaml
27+
ignored:
28+
- DL3008
29+
EOT
30+
docker run --rm -i -v /"${PWD}"/.hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < docker/Dockerfile
31+
32+
build-docker:
33+
runs-on: ubuntu-latest
34+
35+
defaults:
36+
run:
37+
shell: "bash -l -e -o pipefail {0}"
38+
39+
steps:
40+
- name: "Checkout code"
41+
uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 0
44+
45+
- name: "Docker build"
46+
run: |
47+
set -x
48+
docker build --rm \
49+
--file docker/Dockerfile \
50+
--build-arg HTSLIB_BRANCH=1.18 \
51+
--tag bambi .
52+
docker run bambi bambi --version

ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[0.17.1]
2+
Add docker tooling and image publishing
3+
14
[0.17.0]
25
Change the --nocall-quality option from an integer to boolean, and ensure it applies to QT tags.
36

docker/Dockerfile

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
FROM debian:bookworm AS htslib_build
2+
3+
ARG HTSLIB_BRANCH
4+
5+
# hadolint ignore=DL3003
6+
RUN apt-get update && \
7+
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
8+
apt-get install -qq -y --no-install-recommends \
9+
autoconf \
10+
automake \
11+
autotools-dev \
12+
build-essential \
13+
ca-certificates \
14+
git \
15+
libbz2-dev \
16+
libcurl4-openssl-dev \
17+
libgd-dev \
18+
liblzma-dev \
19+
libssl-dev \
20+
&& \
21+
export HTSLIB=/usr/local/src/htslib && \
22+
git clone --depth 1 --branch "${HTSLIB_BRANCH}" https://github.com/samtools/htslib.git "${HTSLIB}" && \
23+
cd "${HTSLIB}" && \
24+
git submodule update --init --recursive && \
25+
mkdir -p /tmp/usr/local && \
26+
autoreconf -i && \
27+
./configure --prefix=/tmp/usr/local && \
28+
make && \
29+
make install
30+
31+
FROM debian:bookworm AS bambi_build
32+
33+
COPY --from=htslib_build /tmp/usr/local /usr/local
34+
COPY . /usr/local/src/bambi
35+
36+
WORKDIR /usr/local/src/bambi
37+
38+
RUN apt-get update && \
39+
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
40+
apt-get install -qq -y --no-install-recommends \
41+
autoconf \
42+
automake \
43+
autotools-dev \
44+
build-essential \
45+
bzip2 \
46+
git \
47+
libbz2-dev \
48+
libcurl4-openssl-dev \
49+
libtool \
50+
libgd-dev \
51+
liblzma-dev \
52+
libxml2-dev \
53+
libz-dev \
54+
libssl-dev \
55+
&& \
56+
export PREFIX=/tmp/usr/local && \
57+
autoreconf -fi && \
58+
CPPFLAGS="-I$PREFIX/include" LDFLAGS="-Wl,-rpath,$PREFIX/lib -L$PREFIX/lib" \
59+
./configure --prefix="$PREFIX" --with-htslib="$PREFIX" && \
60+
make CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" && \
61+
make install prefix="$PREFIX"
62+
63+
FROM debian:bookworm AS bambi
64+
65+
COPY --from=htslib_build /tmp/usr/local /usr/local
66+
COPY --from=bambi_build /tmp/usr/local /usr/local
67+
68+
RUN apt-get update && \
69+
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
70+
apt-get install -qq -y --no-install-recommends \
71+
libbz2-1.0 \
72+
libcurl4 \
73+
libgd3 \
74+
liblzma5 \
75+
libxml2 \
76+
libz1 \
77+
libssl3 \
78+
&& \
79+
apt-get remove -q -y unattended-upgrades && \
80+
apt-get autoremove -q -y && \
81+
apt-get clean && \
82+
rm -rf /var/lib/apt/lists/*
83+
84+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)