From 123b26960fa94b3a1e9952b8ff9a098f4de55ecf Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Wed, 11 Dec 2024 06:23:41 +0100 Subject: [PATCH] Another attempt at fixing the workflow --- .github/workflows/release.yml | 15 ++++++++------- pom.xml | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e58ba21..5ec3463 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,11 +19,6 @@ jobs: java-version: '17' distribution: 'zulu' - - name: Install xmlstarlet - run: | - sudo apt-get update - sudo apt-get install -y xmlstarlet - - name: Cache Maven dependencies uses: actions/cache@v2 with: @@ -35,10 +30,16 @@ jobs: - name: Build with Maven run: mvn clean install -DskipTests - - name: Extract version from pom.xml + + - name: Extract version from pom.xml using sed id: version run: | - VERSION=$(xmlstarlet sel -t -m "/project/version" -v . pom.xml) + VERSION=$(sed -n 's/.*\([^<]*\)<\/version>.*/\1/p' pom.xml | head -n 1) + echo "Extracted VERSION: $VERSION" + if [[ -z "$VERSION" ]]; then + echo "Failed to extract version from pom.xml" + exit 1 + fi echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Check if the version already exists diff --git a/pom.xml b/pom.xml index 49e413e..6ab4eb5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.keycloakify.keycloak keycloak-admin-events-logger - 1.0-SNAPSHOT + 0.0.1 jar