Skip to content

Commit

Permalink
Support retirement of classes #7 (#16)
Browse files Browse the repository at this point in the history
* added retired/relesed classes check for MoveEntitiesToParentResult, MoveHierarchyNodeResult
* updated release.yaml to no longer remove -WHO from versions
---------

Co-authored-by: Gheorghe Soimu <soimugeo@gmail.com>
  • Loading branch information
soimugeoWB and soimugeo committed Jun 20, 2024
1 parent 43ca492 commit a652ab2
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- master-who

jobs:
build:
Expand All @@ -29,20 +30,47 @@ jobs:
server-password: OSSRH_TOKEN
gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}}
gpg-passphrase: GPG_PASSPHRASE
- 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 with Maven
run: mvn --batch-mode -Prelease deploy
- name: Release
uses: softprops/action-gh-release@v1
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:
GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}}
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}
OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>edu.stanford.protege</groupId>
<artifactId>webprotege-backend-api</artifactId>
<version>1.0.23</version>
<version>1.0.23-WHO</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.stanford.protege.webprotege.bulkop;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.*;
import edu.stanford.protege.webprotege.dispatch.Result;

/**
Expand All @@ -11,6 +11,6 @@


@JsonTypeName("webprotege.entities.MoveEntitiesToParent")
public record MoveEntitiesToParentResult() implements Result {
public record MoveEntitiesToParentResult(@JsonProperty("isDestinationRetiredClass") boolean isDestinationRetiredClass) implements Result {

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package edu.stanford.protege.webprotege.hierarchy;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.*;
import edu.stanford.protege.webprotege.dispatch.Result;

/**
Expand All @@ -10,6 +9,7 @@


@JsonTypeName("webprotege.hierarchies.MoveHierarchyNode")
public record MoveHierarchyNodeResult(@JsonProperty("moved") boolean moved) implements Result {
public record MoveHierarchyNodeResult(@JsonProperty("moved") boolean moved,
@JsonProperty("isDestinationRetiredClass") boolean isDestinationRetiredClass) implements Result {

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void shouldSerializeAction() throws IOException {

@Test
public void shouldSerializeResult() throws IOException {
var result = new MoveEntitiesToParentResult();
var result = new MoveEntitiesToParentResult(true);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void shouldSerializeAction() throws IOException {

@Test
public void shouldSerializeResult() throws IOException {
var result = new MoveHierarchyNodeResult(true);
var result = new MoveHierarchyNodeResult(true, false);

}
}

0 comments on commit a652ab2

Please sign in to comment.