rm arm64 hinweis #72
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
name: Release | |
on: | |
push: | |
branches: [ main ] | |
tags-ignore: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Set up api-telematik | |
run: | | |
mkdir api/ && cd api/ | |
git config --global user.email "no_reply@sberg.net" | |
git config --global user.name "Release Bot" | |
git clone https://github.com/gematik/api-telematik.git | |
- name: Extract release notes | |
id: extract-release-notes | |
uses: ffurrer2/extract-release-notes@v1 | |
- name: Build with Maven | |
id: build_maven | |
run: | | |
mvn -B package --file pom.xml | |
VERSION=$(mvn --non-recursive help:evaluate -Dexpression=project.version -q -DforceStdout | grep -v '\[.*') | |
echo "::set-output name=version::$VERSION" | |
- uses: mukunku/tag-exists-action@v1.1.0 | |
id: checkTag | |
with: | |
tag: OpenKIM-${{ steps.build_maven.outputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish new version | |
if: steps.checkTag.outputs.exists == 'false' | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_name: sberg-net/openkim | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/openkim-${{ steps.build_maven.outputs.version }}.jar | |
tag: OpenKIM-${{ steps.build_maven.outputs.version }} | |
overwrite: false | |
body: ${{ steps.extract-release-notes.outputs.release_notes }} | |
- name: Docker meta | |
if: steps.checkTag.outputs.exists == 'false' | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
sbergit/openkim | |
tags: | | |
type=raw,value=latest | |
type=match,pattern=[0-9]+.[0-9]+.[0-9]+,value=v${{ steps.build_maven.outputs.version }} | |
#type=match,pattern=[0-9]+.[0-9]+,value=v${{ steps.build_maven.outputs.version }} | |
#type=sha | |
- name: Set up Docker Buildx | |
if: steps.checkTag.outputs.exists == 'false' | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Inspect builder | |
if: steps.checkTag.outputs.exists == 'false' | |
run: | | |
echo "Name: ${{ steps.buildx.outputs.name }}" | |
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" | |
echo "Status: ${{ steps.buildx.outputs.status }}" | |
echo "Flags: ${{ steps.buildx.outputs.flags }}" | |
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | |
echo "Tags: ${{ steps.meta.outputs.tags }}" | |
- name: Login to DockerHub | |
if: steps.checkTag.outputs.exists == 'false' | |
uses: docker/login-action@v3 | |
with: | |
username: sbergit | |
password: ${{ secrets.DOCKER_HUB }} | |
- name: Build and push | |
if: steps.checkTag.outputs.exists == 'false' | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: docker/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |