Skip to content

release

release #13

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
snapshot:
description: 'Use snapshot version?'
required: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build, tag, and push image
env:
FULL_IMAGE_NAME: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
run: |
version=$(gradle properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')
if [ "${{ github.event.inputs.snapshot }}" != "true" ]; then
version="${version//-SNAPSHOT/}"
fi
echo "Using version: $version"
echo "heimdall_version=$version" >> "$GITHUB_ENV"
gradle build -i -Pversion=$version -Dquarkus.container-image.build=true -Dquarkus.container-image.image=$FULL_IMAGE_NAME:$version -Dquarkus.container-image.push=true
- name: Git tag
uses: rickstaa/action-create-tag@v1
if: "!contains(env.heimdall_version, 'SNAPSHOT')"
with:
tag: "${{ env.heimdall_version }}"
tag_exists_error: false