Skip to content

Commit

Permalink
Update to version 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Jun 29, 2024
1 parent 50db57f commit 7e94bff
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 37 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
default: true
type: boolean
publish_maven:
description: 'Create Maven bundle'
description: 'Create Maven release'
default: true
type: boolean
skip_validation:
Expand All @@ -30,6 +30,11 @@ jobs:
with:
java-version: 17
distribution: temurin
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Install required software
run: |
sudo apt install xmlstarlet
Expand All @@ -45,36 +50,14 @@ jobs:
run: |
[ "${{ inputs.version }}" == "${BUILD_VERSION}" ] || (>&2 echo "Version does not match value in pom.xml"; exit -1)
[ "${{ inputs.version }}" == "$(cat README.md | grep -m 1 '<version>' | tr -d '<>/[:alpha:][:space:]')" ] || (>&2 echo "Version does not match value in README.md"; exit -1)
- name: Build artifact
run: mvn package javadoc:jar
- name: Sign Maven artifacts and create bundle
- name: Build and stage Maven artifacts
if: ${{ inputs.publish_maven }}
run: |
echo -n "${GPG_SIGNING_KEY}" | base64 --decode | gpg --import
mkdir maven
cp pom.xml maven/${BUILD_ARTIFACT}.pom
cp target/${BUILD_ARTIFACT}.jar maven/
cp target/${BUILD_ARTIFACT}-sources.jar maven/
cp target/${BUILD_ARTIFACT}-javadoc.jar maven/
[ -f "target/${BUILD_ARTIFACT}-jar-with-dependencies.jar" ] && cp target/${BUILD_ARTIFACT}-jar-with-dependencies.jar maven/
pushd maven
gpg -ab ${BUILD_ARTIFACT}.pom
gpg -ab ${BUILD_ARTIFACT}.jar
gpg -ab ${BUILD_ARTIFACT}-sources.jar
gpg -ab ${BUILD_ARTIFACT}-javadoc.jar
[ -f "${BUILD_ARTIFACT}-jar-with-dependencies.jar" ] && gpg -ab ${BUILD_ARTIFACT}-jar-with-dependencies.jar
jar -cvf ${BUILD_ARTIFACT}-bundle.jar *
mvn --batch-mode deploy
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Upload Maven bundle
if: ${{ inputs.publish_maven }}
uses: actions/upload-artifact@v4
with:
name: Maven bundle
path: maven/*-bundle.jar
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Stage GitHub release
if: ${{ inputs.publish_github }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Add the following dependency to your `pom.xml`:
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>pisa-plugin</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

Expand All @@ -27,7 +27,7 @@ MOEA Framework, use the table below to identify which version of this plugin to

MOEA Framework Version | Compatible PISA-Plugin Version
---------------------- | ------------------------------
**`>= 4.0`** | **`2.0.0`**
**`>= 4.0`** | **`>= 2.0.0`**
`>= 3.8` | `1.0.3`
`3.7` | `1.0.2`
`<= 3.6` | Not available
Expand Down
86 changes: 79 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.moeaframework</groupId>
<artifactId>pisa-plugin</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>jar</packaging>

<name>PISA Plugin for the MOEA Framework</name>
Expand Down Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>org.moeaframework</groupId>
<artifactId>moeaframework</artifactId>
<version>4.1</version>
<version>4.3</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -55,28 +55,100 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>deploy</phase>
<goals>
<goal>jar</goal>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<version>3.7.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>deploy</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalOptions>
<additionalOption>-Xdoclint:none</additionalOption>
</additionalOptions>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<id>nexus-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<serverId>ossrh</serverId>
</configuration>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>ossrh</id>
<name>Nexus Staging Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>

0 comments on commit 7e94bff

Please sign in to comment.