Skip to content

Commit af0fdb6

Browse files
committed
Add a Docker image
1 parent 3148e82 commit af0fdb6

File tree

6 files changed

+51
-3
lines changed

6 files changed

+51
-3
lines changed

.github/workflows/release-packages.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
ln -s contrib/debian debian
3030
sed -i 's/nvc (.*)/nvc (${{ env.VERSION }}-1)/' debian/changelog
31-
sudo apt-get build-dep .
31+
sudo apt-get -y build-dep .
3232
dpkg-buildpackage -uc -us -b
3333
mv ../nvc_${{ env.VERSION }}-1_amd64.deb nvc_${{ env.VERSION }}-1_amd64_${{ matrix.os }}.deb
3434
- name: 'Upload artifact'
@@ -49,3 +49,18 @@ jobs:
4949
fetch-depth: 0
5050
- name: Build MSI installer
5151
uses: ./.github/actions/windows-installer
52+
53+
docker:
54+
name: Docker image
55+
runs-on: ubuntu-24.04
56+
steps:
57+
- uses: actions/checkout@v3
58+
with:
59+
fetch-depth: 1
60+
- name: Build Docker image
61+
run: ./contrib/docker/build.sh
62+
- name: Push to ghcr.io
63+
run : |
64+
echo "${{ secrets.GHCR_TOKEN }}" | docker login -u ${{ vars.GHCR_USER }} --password-stdin
65+
docker image tag ghdl:current ${{ steps.build.outputs.ghdl_image }}
66+
docker push ghcr.io/nickg/nvc:latest

contrib/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Section: misc
44
Priority: optional
55
Standards-Version: 3.9.2
66
Build-Depends: debhelper (>= 9), tcl-dev, llvm-dev, libreadline-dev,
7-
check, libzstd-dev, libdw-dev
7+
check, libzstd-dev, libdw-dev, libjansson-dev, flex, pkg-config
88

99
Package: nvc
1010
Architecture: any

contrib/debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
override_dh_auto_configure:
66
dh_auto_configure --builddirectory=build/x-debian -- \
7-
--enable-tcl
7+
--enable-tcl --enable-server

contrib/docker/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM debian:bookworm AS build
2+
WORKDIR /src
3+
COPY . .
4+
RUN ln -s contrib/debian .
5+
ARG VERSION
6+
RUN sed -i "s/nvc (.*)/nvc ($VERSION-1)/" debian/changelog
7+
RUN apt-get -y update
8+
RUN apt-get -y build-dep .
9+
RUN DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -uc -us -b
10+
11+
FROM debian:bookworm
12+
RUN --mount=from=build,target=/src \
13+
apt-get -y update && \
14+
apt-get -y install /src/nvc_*.deb && \
15+
rm -rf /var/lib/apt/lists/*
16+
RUN nvc --version
17+
CMD ["/usr/bin/nvc"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- mode: fundamental -*-
2+
build/
3+
contrib/docker/
4+
.github/
5+
*~
6+
configure

contrib/docker/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e -o pipefail
3+
4+
cd $(dirname ${BASH_SOURCE[0]})/../..
5+
6+
vers=$(sed -n '1s/AC_INIT(\[.*\], \[\([0-9\.]*\).*\].*/\1/p' configure.ac)
7+
8+
docker build -f contrib/docker/Dockerfile . \
9+
--build-arg VERSION=$vers \
10+
--tag ghcr.io/nickg/nvc:latest

0 commit comments

Comments
 (0)