increase major version #108
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
# 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: Build Pipeline | |
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 -Dbuild.number=${{github.run_number}} -Dbuild.revision=${GITHUB_SHA} --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" |