Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Publishes this package when a GitHub release is created.
# https://docs.github.com/en/actions/tutorials/publish-packages/publish-java-packages-with-maven
#
# That guide's Maven Central example still points at the legacy OSSRH staging
# repository. This workflow publishes to the Central Portal instead.
#
# Repository secrets:
# CENTRAL_USERNAME, CENTRAL_TOKEN — user token from https://central.sonatype.com
# MAVEN_GPG_PRIVATE_KEY — ASCII-armored GPG private key
# MAVEN_GPG_PASSPHRASE — passphrase for that key, if it has one

name: Publish package to the Maven Central Repository and GitHub Packages

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6

- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Publish to the Maven Central Repository
run: mvn --batch-mode deploy -Pcentral
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven

- name: Publish to GitHub Packages
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018 The Python Packaging Authority
Copyright (c) 2023 Rick W. Porter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Coverage](.github/badges/jacoco.svg)
![Branches](.github/badges/branches.svg)

Display data in a tabular form with Java
Displays List and Map data in a variety of forms.

The data can be output in several different different forms:
* **text** - attractive ASCII format
Expand Down
123 changes: 120 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>rickwporter.prettytable</groupId>
<artifactId>rickwporter-prettytable</artifactId>
<groupId>io.github.rickwporter</groupId>
<artifactId>prettytable</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<name>rickwporter-prettytable</name>
<description>Displays List and Map object data in a variety of forms (e.g. text [ascii], rich [utf-8], csv, html, json)</description>
<url>https://github.com/rickwporter/prettytable-java</url>
<developers>
<developer>
<name>Rick W. Porter</name>
<email>rickwporter@gmail.com</email>
<id>rickwporter</id>
</developer>
</developers>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/rickwporter/prettytable-java.git</connection>
<developerConnection>scm:git:ssh://git@github.com/rickwporter/prettytable-java.git</developerConnection>
<url>https://github.com/rickwporter/prettytable-java</url>
</scm>

<properties>
<!-- Project stuff -->
Expand All @@ -26,6 +46,13 @@
<!-- Checkstyle -->
<version.plugin.checkstyle>3.6.0</version.plugin.checkstyle>
<version.checkstyle>8.30</version.checkstyle>

<!-- Publish -->
<version.plugin.source>3.4.0</version.plugin.source>
<version.plugin.javadoc>3.12.0</version.plugin.javadoc>
<version.plugin.gpg>3.2.8</version.plugin.gpg>
<version.plugin.deploy>3.2.0</version.plugin.deploy>
<version.plugin.central>0.12.0</version.plugin.central>
</properties>

<dependencies>
Expand Down Expand Up @@ -127,7 +154,97 @@
<silent>true</silent>
</configuration>
</plugin>
<!-- Sources jar required by Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${version.plugin.source}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc jar required by Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${version.plugin.javadoc}</version>
<configuration>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/rickwporter/prettytable-java</url>
</repository>
</distributionManagement>

<profiles>
<!-- mvn deploy -Pcentral publishes to Maven Central. The deploy plugin is skipped
so this profile does not also upload to GitHub Packages. -->
<profile>
<id>central</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.plugin.gpg}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</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>${version.plugin.deploy}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${version.plugin.central}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Loading