Skip to content

small fixes

small fixes #91

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Replace "SNAPSHOT" within POM version with date, build number and commit hash
run: |
snapshot_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
major_minor_patch=$(echo "${snapshot_version}" | sed 's/SNAPSHOT//g')
date=$(date -u +%Y%m%d%H%M)
release_candidate_version=${major_minor_patch}${date}-${{github.run_number}}-${GITHUB_SHA::8}
mvn versions:set -DnewVersion=${release_candidate_version}
- name: Build with Maven
run: mvn -B deploy --file pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/actions/delete-package-versions
- uses: actions/delete-package-versions@v4
with:
package-name: 'com.inventage.keycloak.extensions.signature '
package-type: 'maven'
min-versions-to-keep: 5
delete-only-pre-release-versions: "true"