diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1dcd9a76f..827867de6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,8 @@ name: Release on: push: branches: - - master* + - master + - master-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 package run: mvn --batch-mode clean package - name: Build and push image @@ -44,7 +72,7 @@ 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: diff --git a/pom.xml b/pom.xml index f4fbef60c..b58db7754 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ edu.stanford.protege webprotege-gwt-ui - 5.0.16 + 5.0.16-WHO pom diff --git a/webprotege-gwt-ui-client/pom.xml b/webprotege-gwt-ui-client/pom.xml index bf6073f6b..85ba77ba6 100644 --- a/webprotege-gwt-ui-client/pom.xml +++ b/webprotege-gwt-ui-client/pom.xml @@ -6,7 +6,7 @@ edu.stanford.protege webprotege-gwt-ui - 5.0.16 + 5.0.16-WHO webprotege-gwt-ui-client diff --git a/webprotege-gwt-ui-server-core/pom.xml b/webprotege-gwt-ui-server-core/pom.xml index 9ed2740c4..3015847a4 100644 --- a/webprotege-gwt-ui-server-core/pom.xml +++ b/webprotege-gwt-ui-server-core/pom.xml @@ -5,7 +5,7 @@ webprotege-gwt-ui edu.stanford.protege - 5.0.16 + 5.0.16-WHO 4.0.0 diff --git a/webprotege-gwt-ui-server/pom.xml b/webprotege-gwt-ui-server/pom.xml index 49cfd4b07..4a3dffee6 100644 --- a/webprotege-gwt-ui-server/pom.xml +++ b/webprotege-gwt-ui-server/pom.xml @@ -6,7 +6,7 @@ edu.stanford.protege webprotege-gwt-ui - 5.0.16 + 5.0.16-WHO webprotege-gwt-ui-server diff --git a/webprotege-gwt-ui-shared-core/pom.xml b/webprotege-gwt-ui-shared-core/pom.xml index ec6ed55f2..d9529d624 100644 --- a/webprotege-gwt-ui-shared-core/pom.xml +++ b/webprotege-gwt-ui-shared-core/pom.xml @@ -5,7 +5,7 @@ webprotege-gwt-ui edu.stanford.protege - 5.0.16 + 5.0.16-WHO 4.0.0 diff --git a/webprotege-gwt-ui-shared/pom.xml b/webprotege-gwt-ui-shared/pom.xml index 9a8ecbc7a..afaf1e7c2 100644 --- a/webprotege-gwt-ui-shared/pom.xml +++ b/webprotege-gwt-ui-shared/pom.xml @@ -6,7 +6,7 @@ edu.stanford.protege webprotege-gwt-ui - 5.0.16 + 5.0.16-WHO webprotege-gwt-ui-shared