Skip to content

[maven-release-plugin] prepare release 0.4.2 #334

[maven-release-plugin] prepare release 0.4.2

[maven-release-plugin] prepare release 0.4.2 #334

name: Build branch
on:
push:
branches:
- jdevelop
pull_request:
types: [opened, synchronize, reopened]
env:
JAVA_VERSION: 21
JDK_DISTRIBUTION: "temurin"
GITHUB_SHA: ${{ github.sha }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Login to Docker Hub
if: ${{ github.actor != 'dependabot[bot]' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Maven build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -e verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
# Docker build
- name: Dockerhub release-raccoon:latest from jdevelop
if: ${{ github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/jdevelop' }}
run: mvn package -DskipTests -Dquarkus.container-image.push=true -Dquarkus.container-image.image=registry.hub.docker.com/jaivalis/release-raccoon:latest '-Dquarkus.jib.labels."org.opencontainers.image.revision"='${{ env.GITHUB_SHA }}
- name: Dockerhub release-raccoon:snapshot from branch
if: ${{ github.actor != 'dependabot[bot]' && github.ref != 'refs/heads/jdevelop' }}
run: mvn package -DskipTests -Dquarkus.container-image.push=true -Dquarkus.container-image.image=registry.hub.docker.com/jaivalis/release-raccoon:snapshot '-Dquarkus.jib.labels."org.opencontainers.image.revision"='${{ env.GITHUB_SHA }}