From d24d0978eca2a57067652bdd05f380c39db7b4bc Mon Sep 17 00:00:00 2001 From: Gheorghe Soimu Date: Thu, 20 Jun 2024 16:25:44 +0300 Subject: [PATCH] updated release.yaml updated pom.xml with new backend-api version --- .github/workflows/release.yaml | 34 +++++++++++++++++++++++++++++++--- pom.xml | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5ec8a3f..3fb98ec 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - main-who jobs: build: @@ -32,9 +33,36 @@ jobs: server-id: docker.io server-username: DOCKER_USERNAME server-password: DOCKER_PASSWORD + - name: Get current version + id: get-version + run: | + current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "Current version: $current_version" + echo "::set-output name=current_version::$current_version" - name: Bump version id: bump - uses: mickem/gh-action-bump-maven-version@v1 + run: | + current_version=${{ steps.get-version.outputs.current_version }} + branch=${GITHUB_REF##*/} + echo "Current branch: $branch" + + # Extract the base version without suffix + base_version=$(echo $current_version | sed -E 's/(-.*)?$//') + + # Increment the base version (assuming semantic versioning) + IFS='.' read -r -a version_parts <<< "$base_version" + version_parts[2]=$((version_parts[2] + 1)) + new_base_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" + + if [[ "$branch" == "master-who" ]]; then + new_version="${new_base_version}-WHO" + else + new_version="$new_base_version" + fi + + echo "New version: $new_version" + mvn versions:set -DnewVersion=$new_version -DgenerateBackupPoms=false + echo ":: set-output name=new_version::$new_version" - name: Build and Publish package run: mvn --batch-mode -Prelease package dockerfile:push - name: Release @@ -42,9 +70,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ steps.bump.outputs.tag }} + tag_name: ${{ steps.bump.outputs.new_version }} generate_release_notes: true env: DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} - DOCKER_TOKEN: ${{secrets.DOCKER_PASSWORD}} + DOCKER_TOKEN: ${{secrets.DOCKER_PASSWORD}} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2f0fd85..15777f1 100644 --- a/pom.xml +++ b/pom.xml @@ -153,7 +153,7 @@ edu.stanford.protege webprotege-backend-api - 1.0.23 + 1.0.24-WHO