Skip to content

Commit

Permalink
Merge pull request #3 from testng-team/release_prep
Browse files Browse the repository at this point in the history
Preparing for a release
  • Loading branch information
krmahadevan authored Jun 19, 2024
2 parents f4a7155 + c972342 commit e4cb726
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
cache: maven

- name: 'Build and test'
run: ./mvnw clean verify
run: ./mvnw clean test
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish package to the Maven Central Repository
on:
push:
branches: [ master ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java and Maven
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Deploy to Maven Central
run: ./mvnw clean deploy -Pdeploy
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
104 changes: 79 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.testng</groupId>
<artifactId>testng-ant</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>

<name>testng-ant</name>
<description>TestNG task for Ant</description>
Expand All @@ -25,6 +25,13 @@
<version>${ant.version}</version>
<scope>provided</scope>
</dependency>
<!-- We will need atleast TestNG 7.10.2 or higher -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>[7.10.2,)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-testutil</artifactId>
Expand All @@ -37,11 +44,6 @@
<version>3.23.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.9.0</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -85,24 +87,76 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>deploy</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

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

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.7.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</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>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
15 changes: 4 additions & 11 deletions src/main/java/org/testng/TestNGAntTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public class TestNGAntTask extends Task {
private String m_testName = "Ant test";
private Boolean m_skipFailedInvocationCounts;
private String m_methods;
private Mode mode = Mode.testng;
private boolean forkJvm = true;
private boolean m_ignoreMissedTestNames;

Expand Down Expand Up @@ -382,14 +381,16 @@ public void setTestName(String s) {
m_testName = s;
}

@Deprecated
// TestNG settings
public void setJUnit(boolean value) {
mode = value ? Mode.junit : Mode.testng;
//No Op
}

@Deprecated
// TestNG settings
public void setMode(Mode mode) {
this.mode = mode;
//No Op
}

public void setForkJvm(boolean forkJvm) {
Expand Down Expand Up @@ -576,14 +577,6 @@ protected List<String> createArguments() {
addReporterConfigs(argv);
addIntegerIfNotNull(argv, CommandLineArgs.SUITE_THREAD_POOL_SIZE, m_suiteThreadPoolSize);
addStringIfNotNull(argv, CommandLineArgs.XML_PATH_IN_JAR, m_xmlPathInJar);
switch (mode) {
case junit:
addBooleanIfTrue(argv, CommandLineArgs.JUNIT, TRUE);
break;
case mixed:
addBooleanIfTrue(argv, CommandLineArgs.MIXED, TRUE);
break;
}
addXmlFiles(argv);
return argv;
}
Expand Down

0 comments on commit e4cb726

Please sign in to comment.