Skip to content

Workflow file for this run

name: Docker image release
on:
push:
tags:
- "v*.*.*"
- "v*.*.*-test"
env:
REGISTRY_IMAGE: holisticon/bpm-ai-connectors-camunda-8
jobs:
build-jvm:
strategy:
matrix:
include:
- runner: ubuntu-latest
arch: amd64
#- runner: buildjet-8vcpu-ubuntu-2204-arm
# arch: arm64
runs-on: ${{ matrix.runner }}
defaults:
run:
working-directory: ./feel-engine-wrapper
steps:
-
name: Checkout code
uses: actions/checkout@v3
-
name: Setup GraalVM JDK 21
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
-
name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ matrix.runner }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ matrix.runner }}-maven-
-
name: Prepare Maven Wrapper
run: chmod +x ./mvnw
-
name: Build native executable with Maven
run: ./mvnw package -Dnative
-
name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: feel-engine-wrapper-${{ matrix.arch }}-runner
path: feel-engine-wrapper/target/feel-engine-wrapper-runner # action does not respect working-directory...
if-no-files-found: error
build-python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bpm-ai-connectors-c8
steps:
-
name: Checkout code
uses: actions/checkout@v3
-
name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
-
name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.6.1"
-
name: Create local environment in project for caching
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
-
uses: actions/cache@v3
name: Set up cache based on dependencies lock file
with:
path: ./bpm-ai-connectors-c8/.venv
key: venv-${{ hashFiles('**/poetry.lock') }}
-
name: Install dependencies
run: poetry install --only main
-
name: Build
run: poetry build
-
name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: bpm-ai-connectors-c8
path: bpm-ai-connectors-c8/dist/ # action does not respect working-directory...
if-no-files-found: error
build-push:
needs: [build-jvm]
strategy:
matrix:
include:
- arch: amd64
#- arch: arm64
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v3
-
uses: actions/download-artifact@v4
with:
name: feel-engine-wrapper-${{ matrix.arch }}-runner
path: feel-engine-wrapper/target
-
run: ls -la feel-engine-wrapper/target
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
run: docker context create builders
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
endpoint: builders
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
-
name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/${{ matrix.arch }}
context: .
file: ./Dockerfile.prebuilt
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-${{ matrix.arch }}
${{ env.REGISTRY_IMAGE }}:latest-${{ matrix.arch }}
build-push-arm64:
if: ${{ false }} # disable for now
#needs: [build-jvm, build-python]
runs-on: macos-14
steps:
-
name: Checkout code
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
run: docker context create builders
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
endpoint: builders
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
-
name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/arm64
build-args: |
TARGETARCH=arm64
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-arm64
${{ env.REGISTRY_IMAGE }}:latest-arm64
pytest-docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bpm-ai-connectors-c8/tests
needs: [build-push]
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'poetry'
cache-dependency-path: bpm-ai-connectors-c8/poetry.lock
-
name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.6.1"
-
name: Install dependencies
run: poetry install --only test --no-root --no-cache
-
name: Run pytest
run: ZEEBE_TEST_IMAGE_TAG=8.4.0 OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} TEST_RUNTIME=docker poetry run pytest
create-push-manifest:
runs-on: ubuntu-latest
needs: [build-push, pytest-docker]
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Get version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
-
name: Create version-manifest and push
run: |
docker manifest create \
${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }} \
--amend ${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-amd64 \
--amend ${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}-arm64
docker manifest push ${{ env.REGISTRY_IMAGE }}:${{ steps.vars.outputs.tag }}
-
name: Create latest-manifest and push
run: |
docker manifest create \
${{ env.REGISTRY_IMAGE }}:latest \
--amend ${{ env.REGISTRY_IMAGE }}:latest-amd64 \
--amend ${{ env.REGISTRY_IMAGE }}:latest-arm64
docker manifest push ${{ env.REGISTRY_IMAGE }}:latest