ci: release version 0.35.4 🎉 #771
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# Copyright (c) The original authors | |
# | |
# Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
name: Docker Builds & Push | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
env: | |
JAVA_VERSION: '21' | |
JAVA_DISTRO: 'zulu' | |
GRAAL_VERSION: '21.0.1' | |
GRAAL_DISTRIBUTION: 'graalvm-community' | |
jobs: | |
build: | |
if: github.repository == 'streamthoughts/jikkou' | |
name: 'Build Docker Image' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- name: 'Set up GraalVM' | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
# version: ${{ env.GRAAL_VERSION }} | |
java-version: ${{ env.JAVA_VERSION }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
components: 'native-image' | |
native-image-job-reports: 'true' | |
native-image-musl: 'true' | |
- name: 'Login to DockerHub' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: 'Set Docker Image Build-Args' | |
run: | | |
echo "VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | |
echo "GIT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV | |
echo "CREATED=$(date --rfc-3339=seconds)" >> $GITHUB_ENV | |
- name: 'Build Native Executable (Jikkou CLI)' | |
run: | | |
chmod +x ./mvnw && \ | |
./mvnw -ntp -B clean package -Pnative -Dgraalvm.build.arg="--static --libc=musl" -DskipTests && \ | |
cp ./cli/target/jikkou-cli-${{ env.VERSION }}-runner ./docker/jikkou-cli-${{ env.VERSION }}-runner | |
- name: 'Build & Push to Docker Hub (Jikkou CLI)' | |
if: github.ref_name == 'main' | |
uses: docker/build-push-action@v6 | |
with: | |
context: docker | |
platforms: linux/amd64,linux/arm64 | |
file: docker/Dockerfile | |
no-cache: true | |
push: true | |
tags: streamthoughts/jikkou:main | |
build-args: | | |
VERSION=${{ env.VERSION }} | |
COMMIT=${{ env.GIT_COMMIT }} | |
BRANCH=${{ env.GIT_BRANCH }} | |
CREATED=${{ env.CREATED }} | |
- name: 'Build & Push to Docker Hub (Jikkou CLI)' | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: docker/build-push-action@v6 | |
with: | |
context: docker | |
platforms: linux/amd64,linux/arm64 | |
file: docker/Dockerfile | |
no-cache: true | |
push: true | |
tags: streamthoughts/jikkou:${{ env.VERSION }},streamthoughts/jikkou:latest | |
build-args: | | |
VERSION=${{ env.VERSION }} | |
COMMIT=${{ env.GIT_COMMIT }} | |
BRANCH=${{ env.GIT_BRANCH }} | |
CREATED=${{ env.CREATED }} | |
- name: 'Build & Push to Docker Hub (Jikkou API Server)' | |
if: github.ref_name == 'main' | |
run: | | |
./mvnw -ntp -B install -DskipTests && \ | |
./mvnw -ntp -B package -DskipTests -f ./server/jikkou-api-server/pom.xml \ | |
-Dpackaging=docker \ | |
-Djib.to.image=streamthoughts/jikkou-api-server:main | |
docker image push --all-tags streamthoughts/jikkou-api-server | |
- name: 'Build & Push to Docker Hub (Jikkou API Server)' | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
./mvnw -ntp -B install -DskipTests && \ | |
./mvnw -ntp -B package -DskipTests -f ./server/jikkou-api-server/pom.xml \ | |
-Dpackaging=docker \ | |
-Djib.to.image=streamthoughts/jikkou-api-server:${{ env.VERSION }} \ | |
-Djib.to.tags=latest | |
docker image push --all-tags streamthoughts/jikkou-api-server |