Prepare 0.12 release #250
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: Java CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn -B -q verify | |
- name: Run Checkstyle | |
run: mvn -q checkstyle:check | |
- name: Run SpotBugs | |
run: mvn -q spotbugs:check | |
- name: Run OWASP dependency-check (only on dev) | |
run: mvn -q org.owasp:dependency-check-maven:check | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
- name: Extract Version | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
mvn help:evaluate -Dexpression=project.version -q -DforceStdout > version.txt | |
- name: Store artifacts | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: | | |
version.txt | |
target/dina-export-api-*.jar | |
Dockerfile | |
push: | |
name: Build Docker Image and Push to DockerHub | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- name: Download artifacts from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
- name: Set VERSION_TAG ENV variable | |
run: | | |
echo "VERSION_TAG=$(cat version.txt)" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Image and Push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: aafcbicoe/dina-export-api:${{ env.VERSION_TAG }} | |
provenance: false |