-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from wtsi-npg/devel
Merge from devel to create release 0.17.1
- Loading branch information
Showing
4 changed files
with
204 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,65 @@ | ||
name: "Create release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- "**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l -e -o pipefail {0} | ||
env: | ||
IMAGE_NAME: bambi | ||
REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Fetch Tags" | ||
# Workaround for https://github.com/actions/checkout/issues/290 | ||
run: git fetch --tags --force | ||
|
||
- name: "Get release variables" | ||
# RELEASE_VERSION assignment must match the command used in autoconf's | ||
# configure.ac file. On update, care should be taken to maintain both | ||
# sides congruent. | ||
run: | | ||
echo 'RELEASE_VERSION='$(git describe --always --tags --dirty) >> $GITHUB_ENV | ||
echo 'GIT_URL='$(git remote get-url origin) >> $GITHUB_ENV | ||
echo 'GIT_COMMIT='$(git log --pretty=format:'%H' -n 1) >> $GITHUB_ENV | ||
- name: "Login to Docker registry" | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Build Docker image" | ||
run: | | ||
set -x | ||
docker build --rm \ | ||
--file docker/Dockerfile \ | ||
--build-arg HTSLIB_BRANCH=1.18 \ | ||
--platform linux/amd64 \ | ||
--progress plain \ | ||
--load \ | ||
--label "org.opencontainers.image.title=bambi" \ | ||
--label "org.opencontainers.image.source=${GIT_URL}" \ | ||
--label "org.opencontainers.image.revision=${GIT_COMMIT}" \ | ||
--label "org.opencontainers.image.version=${RELEASE_VERSION}" \ | ||
--label "org.opencontainers.image.created=$(date --utc --iso-8601=seconds)" \ | ||
--tag "ghcr.io/$REPOSITORY_OWNER/${IMAGE_NAME}:${RELEASE_VERSION}" \ | ||
--tag "ghcr.io/$REPOSITORY_OWNER/${IMAGE_NAME}:latest" \ | ||
. | ||
- name: "Push image to registry" | ||
run: | | ||
docker push "ghcr.io/$REPOSITORY_OWNER/$IMAGE_NAME:$RELEASE_VERSION" | ||
docker push "ghcr.io/$REPOSITORY_OWNER/$IMAGE_NAME:latest" |
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,52 @@ | ||
name: "Lint and test-build Dockerfile" | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
lint-docker: | ||
runs-on: ubuntu-latest | ||
|
||
continue-on-error: true | ||
|
||
defaults: | ||
run: | ||
shell: "bash -l -e -o pipefail {0}" | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Lint Dockerfile" | ||
run: | | ||
cat <<EOT >> .hadolint.yaml | ||
ignored: | ||
- DL3008 | ||
EOT | ||
docker run --rm -i -v /"${PWD}"/.hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < docker/Dockerfile | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: "bash -l -e -o pipefail {0}" | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Docker build" | ||
run: | | ||
set -x | ||
docker build --rm \ | ||
--file docker/Dockerfile \ | ||
--build-arg HTSLIB_BRANCH=1.18 \ | ||
--tag bambi . | ||
docker run bambi bambi --version |
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
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,84 @@ | ||
FROM debian:bookworm AS htslib_build | ||
|
||
ARG HTSLIB_BRANCH | ||
|
||
# hadolint ignore=DL3003 | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
apt-get install -qq -y --no-install-recommends \ | ||
autoconf \ | ||
automake \ | ||
autotools-dev \ | ||
build-essential \ | ||
ca-certificates \ | ||
git \ | ||
libbz2-dev \ | ||
libcurl4-openssl-dev \ | ||
libgd-dev \ | ||
liblzma-dev \ | ||
libssl-dev \ | ||
&& \ | ||
export HTSLIB=/usr/local/src/htslib && \ | ||
git clone --depth 1 --branch "${HTSLIB_BRANCH}" https://github.com/samtools/htslib.git "${HTSLIB}" && \ | ||
cd "${HTSLIB}" && \ | ||
git submodule update --init --recursive && \ | ||
mkdir -p /tmp/usr/local && \ | ||
autoreconf -i && \ | ||
./configure --prefix=/tmp/usr/local && \ | ||
make && \ | ||
make install | ||
|
||
FROM debian:bookworm AS bambi_build | ||
|
||
COPY --from=htslib_build /tmp/usr/local /usr/local | ||
COPY . /usr/local/src/bambi | ||
|
||
WORKDIR /usr/local/src/bambi | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
apt-get install -qq -y --no-install-recommends \ | ||
autoconf \ | ||
automake \ | ||
autotools-dev \ | ||
build-essential \ | ||
bzip2 \ | ||
git \ | ||
libbz2-dev \ | ||
libcurl4-openssl-dev \ | ||
libtool \ | ||
libgd-dev \ | ||
liblzma-dev \ | ||
libxml2-dev \ | ||
libz-dev \ | ||
libssl-dev \ | ||
&& \ | ||
export PREFIX=/tmp/usr/local && \ | ||
autoreconf -fi && \ | ||
CPPFLAGS="-I$PREFIX/include" LDFLAGS="-Wl,-rpath,$PREFIX/lib -L$PREFIX/lib" \ | ||
./configure --prefix="$PREFIX" --with-htslib="$PREFIX" && \ | ||
make CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" && \ | ||
make install prefix="$PREFIX" | ||
|
||
FROM debian:bookworm AS bambi | ||
|
||
COPY --from=htslib_build /tmp/usr/local /usr/local | ||
COPY --from=bambi_build /tmp/usr/local /usr/local | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
apt-get install -qq -y --no-install-recommends \ | ||
libbz2-1.0 \ | ||
libcurl4 \ | ||
libgd3 \ | ||
liblzma5 \ | ||
libxml2 \ | ||
libz1 \ | ||
libssl3 \ | ||
&& \ | ||
apt-get remove -q -y unattended-upgrades && \ | ||
apt-get autoremove -q -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
CMD ["/bin/bash"] |