Skip to content

Commit

Permalink
.github/workflows/ci: Push docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisMontagne committed Oct 8, 2024
1 parent 74a406b commit d46cd10
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.git/
CMakeFiles/
CMakeCache.txt
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ jobs:
- name: tar types
run: |
tar -cvf dist/types.tar types
- name: move thrift-docker
run: |
cp contrib/thrift-docker dist
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker container
uses: upfluence/actions/build-docker@master
with:
version: ${{ needs.compute-version.outputs.version }}
registries: ghcr.io
- name: Create release
uses: upfluence/actions/create-github-release@master
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,5 @@ test-driver
/CPack*.cmake
/compile_commands.json
/install_manifest.txt
**/*.cmake
**/CMakeFiles
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
#
# TODO: push to apache/thrift-compiler instead of thrift/thrift-compiler

FROM debian:jessie
FROM debian:latest
MAINTAINER Apache Thrift <[email protected]>

ENV DEBIAN_FRONTEND noninteractive
ARG SEMVER_VERSION=v0.0.0

ADD . /thrift

Expand All @@ -43,19 +44,22 @@ RUN buildDeps=" \
apt-get update && apt-get install -y --no-install-recommends $buildDeps \
&& mkdir /tmp/cmake-build && cd /tmp/cmake-build \
&& cmake \
-DTHRIFT_VERSION=${SEMVER_VERSION#v}-upfluence \
-DBUILD_COMPILER=ON \
-DBUILD_LIBRARIES=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
/thrift \
&& cmake --build . --config Release \
&& make install \
&& curl -k -sSL "https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
&& curl -k -sSL "https://storage.googleapis.com/golang/go1.23.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
&& tar xzf /tmp/go.tar.gz -C /tmp \
&& cp /tmp/go/bin/gofmt /usr/bin/gofmt \
&& apt-get purge -y --auto-remove $buildDeps \
&& apt-get clean \
&& rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /data

ENTRYPOINT ["thrift"]
3 changes: 3 additions & 0 deletions contrib/thrift-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TAG=${TAG:-"latest"}

exec docker run --pull always -v "${PWD}:/data" --rm -it ghcr.io/upfluence/thrift:${TAG} $@
6 changes: 6 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,10 @@ EXTRA_DIST = \

precross-%:
$(MAKE) -C $* precross

precross: precross-nodejs precross-csharp precross-java

generate-types-%:
$(MAKE) -C $* generate-types

generate-types: generate-types-go generate-types-rb generate-types-cpp
10 changes: 10 additions & 0 deletions lib/cpp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,13 @@ EXTRA_DIST = \

style-local:
$(CPPSTYLE_CMD)

TYPE_FILES = ../../types/*.thrift ../../types/known/*.thrift

$(TYPE_FILES):
mkdir -p src/thrift/$(patsubst ../../%,%,$(dir $@))
$(THRIFT) -gen cpp --out src/thrift/$(patsubst ../../%,%,$(dir $@)) $@

generate-types: $(TYPE_FILES)

.PHONY: generate-types $(TYPE_FILES)

0 comments on commit d46cd10

Please sign in to comment.