Skip to content

Commit

Permalink
Tca v146 (#31)
Browse files Browse the repository at this point in the history
* update container image to install the lib
* set id on step for setting tags
  • Loading branch information
tcarland authored Aug 7, 2023
1 parent 3c0cf96 commit 1ee612a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 32 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/c-cpp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
38 changes: 38 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -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", "--"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
20 changes: 0 additions & 20 deletions build/Containerfile

This file was deleted.

2 changes: 1 addition & 1 deletion include/tcanetpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

0 comments on commit 1ee612a

Please sign in to comment.