From 1ee612a426758fd82adc2f1c712b38866f803a0b Mon Sep 17 00:00:00 2001 From: "Timothy C. Arland" Date: Mon, 7 Aug 2023 06:36:21 -0600 Subject: [PATCH] Tca v146 (#31) * update container image to install the lib * set id on step for setting tags --- .github/workflows/c-cpp-build.yml | 20 +++++++++------- Containerfile | 38 +++++++++++++++++++++++++++++++ Makefile | 6 ++--- build/Containerfile | 20 ---------------- include/tcanetpp.h | 2 +- 5 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 Containerfile delete mode 100644 build/Containerfile diff --git a/.github/workflows/c-cpp-build.yml b/.github/workflows/c-cpp-build.yml index 1b7335a4..20aa0202 100644 --- a/.github/workflows/c-cpp-build.yml +++ b/.github/workflows/c-cpp-build.yml @@ -8,11 +8,10 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }}-build + IMAGE_NAME: ${{ github.repository }} jobs: build: - runs-on: ubuntu-latest permissions: @@ -28,12 +27,17 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/metadata-action@v3 + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v3 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build Container - run: docker build -t ${{ env.IMAGE_NAME }} -f build/Containerfile . - - - name: Run Docker Build - run: docker run --rm -v $PWD:/app -e TCAMAKE_HOME=/tcamake ${{ env.IMAGE_NAME }} /bin/bash -c "cd /app && source resources/tcanetpp_release_mt && make arlib" + - name: Build and push the Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./Containerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Containerfile b/Containerfile new file mode 100644 index 00000000..87f07e96 --- /dev/null +++ b/Containerfile @@ -0,0 +1,38 @@ +FROM ubuntu:22.04 +LABEL Description="CPP Build Environment" + +ARG TCAMAKE_VERSION=v23.08 + +ENV HOME /root +ENV TCAMAKE_PROJECT /usr/lib +ENV TCAMAKE_PREFIX /usr + +shell ["/bin/bash", "-c"] + +RUN apt-get update && apt-get -y --no-install-recommends install \ + build-essential \ + ca-certificates \ + curl \ + libtool \ + liblz4-dev \ + libssl-dev \ + libzstd-dev \ + net-tools \ + pkg-config \ + rsync \ + tini + +WORKDIR /opt + +RUN curl https://github.com/tcarland/tcamake/archive/refs/tags/${TCAMAKE_VERSION}.tar.gz -L -o /tmp/tcamake.tar.gz && \ + tar -xzf /tmp/tcamake.tar.gz && \ + mv tcamake-* tcamake && \ + rm /tmp/tcamake.tar.gz + +RUN mkdir -p /opt/tcanetpp +COPY . /opt/tcanetpp + +RUN cd tcanetpp && source resources/tcanetpp_release_mt && \ + make arlib solib cmdbuf && make install && make distclean + +ENTRYPOINT ["/usr/bin/tini", "--"] \ No newline at end of file diff --git a/Makefile b/Makefile index 6c4beb85..e57e3cf0 100644 --- a/Makefile +++ b/Makefile @@ -55,14 +55,14 @@ all: lib cmdbuf lib: arlib arlib: lib/libtcanetpp.a -solib: libtcanetpp.so.1.4.5 +solib: libtcanetpp.so.1.4.6 libtcapt: lib/libtcapt.a cmdbuffer: cmdbuf cmdbuf: libcmdbuf libcmdbuf: lib/libcmdbuf.a -libtcanetpp.so.1.4.5: ${OBJS} +libtcanetpp.so.1.4.6: ${OBJS} ( $(MKDIR) lib ) ( $(RM) $@ lib/libtcanetpp.so ) $(make-so-rule) @@ -132,5 +132,5 @@ ifdef TCAMAKE_PREFIX @echo else @echo "TCAMAKE_PREFIX is not set. Install not performed" - @echo " eg. export TCAMAKE_PREFIX=/usr/local" + @echo " eg. export TCAMAKE_PREFIX=/usr" endif diff --git a/build/Containerfile b/build/Containerfile deleted file mode 100644 index f3e3e184..00000000 --- a/build/Containerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:22.04 -LABEL Description="CPP Build Environment" - -ENV HOME /root - -shell ["/bin/bash", "-c"] - -RUN apt-get update && apt-get -y --no-install-recommends install \ - build-essential \ - ca-certificates \ - curl \ - net-tools \ - tini - -RUN curl https://github.com/tcarland/tcamake/archive/refs/tags/v23.08.tar.gz -L -o /tmp/tcamake.tar.gz && \ - tar -xzf /tmp/tcamake.tar.gz -C / && \ - mv /tcamake-* /tcamake && \ - rm /tmp/tcamake.tar.gz - -ENTRYPOINT ["/usr/bin/tini", "--"] \ No newline at end of file diff --git a/include/tcanetpp.h b/include/tcanetpp.h index 15e71798..84ff34d1 100644 --- a/include/tcanetpp.h +++ b/include/tcanetpp.h @@ -36,6 +36,6 @@ #include "event/EventManager.h" #define TCANETPP_VERSION_TS "23.08" -#define TCANETPP_VERSION "1.4.5" +#define TCANETPP_VERSION "1.4.6" #endif _TCANETPP_H_