Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions .github/workflows/docker-build.yml

This file was deleted.

17 changes: 13 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ published ]

jobs:
build:
Expand Down Expand Up @@ -46,7 +48,14 @@ jobs:
else
eap="-eap"
fi
mainVersion="1.0.$RUN_NUMBER"

# Use release tag if available, otherwise parse from pom.xml
if [ -n "${RELEASE_TAG}" ] && [ "${RELEASE_TAG}" != "" ]; then
mainVersion="${RELEASE_TAG#v}" # Remove 'v' prefix if present
else
mainVersion="$(grep -m1 -oP '(?<=<version>)[^<]+' pom.xml)"
fi

ver="$mainVersion-$keycloakVersion${eap}-$gitrev"
echo "version=$ver" >>"$GITHUB_OUTPUT"
echo "mainVersion=$mainVersion" >>"$GITHUB_OUTPUT"
Expand All @@ -55,7 +64,7 @@ jobs:
mvn --batch-mode versions:set "-DnewVersion=$ver"
env:
BRANCH_REF: ${{ github.ref }}
RUN_NUMBER: ${{ github.run_number }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
- name: Check for update of KeyCloak
run: |
newestKcVersion="$(curl https://api.github.com/repos/keycloak/keycloak/releases/latest | jq -r .name)"
Expand Down Expand Up @@ -87,7 +96,7 @@ jobs:
# https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven
- name: Publish to mvn artifact to GitHub Packages
run: mvn --batch-mode deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
Expand All @@ -98,7 +107,7 @@ jobs:
docker:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'release'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<groupId>ch.openem.keycloakadminhelperplugin</groupId>
<artifactId>keycloak-facilities-admin-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>keycloak-facilities-admin-plugin</name>
<url>http://maven.apache.org</url>

<properties>
<!-- other properties -->
<keycloak.version>26.5.4</keycloak.version>
</properties>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -65,15 +74,6 @@
</plugins>
</build>

<version>1.0.0-rc2-SNAPSHOT</version>
<name>keycloak-facilities-admin-plugin</name>
<url>http://maven.apache.org</url>

<properties>
<!-- other properties -->
<keycloak.version>26.5.4</keycloak.version>
</properties>

<dependencies>
<!-- testing -->
<dependency>
Expand Down
Loading