Release #197
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
name: Release | |
on: | |
create: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '21' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Generate version | |
if: startsWith(github.ref, 'refs/tags/') | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
############# DOCKER BUILD | |
- name: Set up QEMU environment | |
uses: docker/setup-qemu-action@v3.2.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.8.0 | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3.3.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push all images | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/build-push-action@v6.10.0 | |
with: | |
context: . | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
build-args: BUILDX_QEMU_ENV=true | |
tags: odin568/fe2_kartengenerierung:${{ env.RELEASE_VERSION }} | |
########## Final release | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
build/libs/*.jar | |
build/dist/*.zip | |
build/dist/*.yml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |