Adopt and release to Maven Central (#2)

* Add GitHub Actions for CI

* Remove unused CI and release files

* Ignore IntelliJ files

* pom: add my parent

* pom: remove redundant packaging element

* pom: update scm repo

* pom: upgrade to Java 1.8

* pom: remove maven-release-plugin

* pom: remove opencollab distributionManagement

* pom: remove releases profile

* pom: add kemitix-maven-tiles: maven-plugins, enforcer, compiler-jdk-8, testing

* Update readme

* Version set to 1.0.2

* github: test build with JDK 8

* github: remove native-image testing
This commit is contained in:
Paul Campbell 2020-08-30 19:42:58 +01:00 committed by GitHub
parent a06c5c1f1a
commit b7f607d49c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 308 additions and 190 deletions

41
.github/GitHub-Actions.org vendored Normal file
View file

@ -0,0 +1,41 @@
* Deploying using Github Actions
** Actions definition: workflow/sonatype-deploy.yml
When a GitHub Release is created, usually from a tag, this action will trigger.
Using JDK8 the software will be packaged, including running any tests.
Then the Deploy script will sign the created artifacts then deploy them according to the distributionManagement configuration in the `pom.xml`.
** Deploy Script
Uses a signing key provided from the GitHub Actions Secrets as an environment variable to sign the artifact(s) before they are then deployed.
*** Inputs
**** DEPLOY_PROJECTS (optional)
An optional list of modules in a multi-module project to be deployed. If this value is not specified, then all projects will be deployed.
** Maven Configuration
Picks up the credentials from Environment variables for authenticating both with GPG and with the target deployment server (e.g. sonatype-nexus).
*** Inputs
**** NEXUS_USERNAME
The username for your account on the deployment server.
**** NEXUS_PASSWORD
The password for your account on the deployement server.
**** GPG_KEYNAME
The key to use when signing.
**** GPG_PASSPHRASE
The passphrase to unlock the key to use when signing.

53
.github/NOTES vendored Normal file
View file

@ -0,0 +1,53 @@
Add subkeys:
????
Publish:
gpg --send-keys --keyserver keyserver.ubuntu.com $KEYID
gpg --send-keys --keyserver pgp.mit.edu $KEYID
gpg --send-keys --keyserver pool.sks-keyservers.net $KEYID
Backup:
gpg --export --armor pcampbell@kemitix.net > gpg-key-backup.asc
gpg --export-secret-keys --armor pcampbell@kemitix.net >> gpg-key-backup.asc
Export sub-keys:
gpg --export-secret-subkeys pcampbell@kemitix.net > subkeys
Remove master keys:
gpg --delete-secret-key pcampbell@kemitix.net
Import sub-keys and clean up:
gpg --import subkeys
shred --remove subkeys
Delete any encryption subkeys:
gpg --edit-key pcampbell@kemitix.net
2
delkey
save
Change passphrase:
gpg --edit-key pcampbell@kemitix.net
passwd
save
Export keys:
gpg --export --armor pcampbell@kemitix.net > codesigning.asc
gpg --export-secret-keys --armor pcampbell@kemitix.net >> codesigning.asc
Encrypt keys:
gpg --symmetric --cipher-algo AES256 codesigning.asc
shred codesigning.asc

BIN
.github/codesigning.asc.gpg vendored Normal file

Binary file not shown.

7
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

34
.github/release-drafter.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'dependencies'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
exclude-labels:
- 'skip-changelog'
template: |
## Changes
$CHANGES

28
.github/settings.xml vendored Normal file
View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>gpg-sign</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>

17
.github/stale.yaml vendored Normal file
View file

@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

23
.github/workflows/build-maven.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: maven-build
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11, 14 ]
steps:
- uses: kamiazya/setup-graphviz@v1
- uses: actions/checkout@v2
- name: setup-jdk-${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: build-jar
run: mvn -B install

40
.github/workflows/deploy-sonatype.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: sonatype-deploy
on:
push:
tags:
- "v*"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: kamiazya/setup-graphviz@v1
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
- name: Build with Maven
run: mvn -B install
- name: Nexus Repo Publish
run: |
gpg --quiet \
--batch \
--yes \
--decrypt \
--passphrase="${{ secrets.GPG_PASSPHRASE }}" \
--output codesigning.asc \
.github/codesigning.asc.gpg
gpg --batch \
--fast-import codesigning.asc
mvn --settings .github/settings.xml \
-Dskip-Tests=true \
-P release \
-B \
deploy
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

14
.github/workflows/draft-release.yml vendored Normal file
View file

@ -0,0 +1,14 @@
name: draft-release
on:
push:
branches:
- master
jobs:
update_draft_release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.11.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
*.iml
.idea/
/target
test.epub
nb-configuration.xml

View file

@ -1,20 +0,0 @@
language: java
jdk:
- oraclejdk8
- oraclejdk7
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "kuMEP/lj5qM4NpEjR+jxLcJIyc7XGWI74FU2gwzMaM0/9HzX8LI2qk1NfqIc5jf1K6jPrLa4bBfMENluaVMizWisM5ShxrRJB9djm0G4rXeyBsmdSsrkmbjxxjqStPwunykVn8Npo5lZsetfRYCdjzSwiY9F/wKLjrwn+nq9YvZV3B3dOVS5ZCAPn0ZugqUAvYtSLX87N3q2SOowHRc8mkQ1MqTsRFC07H2rdo6qAcCROsVLhmMKRFSk/jPwFYPMFKYuDlwMEj/reqqJ0KpPoJ3qu9FPmHDwhyWwVl/T+eZEf6bJ0Q5BjWeXLgzgqaytrQX9p8x2dAYYBInTvH1zpeAoOB8vMAdKm7kcuLE5ovVmuq95akQ0Qe41mcx2f6JQ2kMRfcxpWLQhcfvoWNSCszmAfVd9fhQUCwqOgE68nJmSZcp5xR1VcG5KV7pKj9coTGOin1vH/lNdAe1OcK9RlwkC4TbEdtaAf5UVsb0tMBn6o9MIs29dViPDPQ14YoXJb89UpkypYzDqLst/557CmOf7Uw8QjgPkQziKS2/gZpihhoZPzT0N5hShteHQGBN+rhBxLDFfT+NxVm6izzKumIp8jPGiYoosr+pDwN3K7smgG+V1T8iy8EVUBXpjT/3AQTxgDI4ZwHr9+0dQm0shgdRJO/GITMx/v6076e657i8="
addons:
coverity_scan:
project:
name: "OpenCollabZA/epub-creator"
description: "Build submitted via Travis CI"
notification_email: samuel@opencollab.co.za
build_command_prepend: "mvn clean"
build_command: "mvn -DskipTests=true compile"
branch_pattern: coverity_scan

View file

@ -1,5 +1,16 @@
# epub-creator
[![epub-creator version](https://img.shields.io/badge/epub--creator-v1.0.0-green.svg?style=flat)](http://semver.org) [![WTFPL license](http://img.shields.io/badge/License-MIT-blue.svg)](http://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/OpenCollabZA/epub-creator.svg)](https://travis-ci.org/OpenCollabZA/epub-creator) [![Coverity Scan Build Status](https://scan.coverity.com/projects/8384/badge.svg)](https://scan.coverity.com/projects/opencollabza-epub-creator)
![GitHub release (latest by date)](
https://img.shields.io/github/v/release/kemitix/epub-creator?style=for-the-badge)
![GitHub Release Date](
https://img.shields.io/github/release-date/kemitix/epub-creator?style=for-the-badge)
[![Nexus](
https://img.shields.io/nexus/r/https/oss.sonatype.org/net.kemitix/epub-creator.svg?style=for-the-badge)](
https://oss.sonatype.org/content/repositories/releases/net/kemitix/epub-creator/)
[![Maven-Central](
https://img.shields.io/maven-central/v/net.kemitix/epub-creator.svg?style=for-the-badge)](
https://search.maven.org/search?q=g:net.kemitix%20a:epub-creator)
# Java EPUB3 creator API
@ -16,7 +27,7 @@ Create EPUB3 standard ebooks.
You will need
1. [Java 7+](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)
1. Java 8+
2. [Maven 3+](https://maven.apache.org/download.cgi)
```

89
pom.xml
View file

@ -1,22 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>kemitix-parent</artifactId>
<groupId>net.kemitix</groupId>
<version>5.3.0</version>
<relativePath/>
</parent>
<groupId>coza.opencollab.epub</groupId>
<artifactId>epub-creator</artifactId>
<version>1.0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<version>1.0.2</version>
<scm>
<connection>scm:git:git@github.com:OpenCollabZA/epub-creator.git</connection>
<url>scm:git:git@github.com:OpenCollabZA/epub-creator.git</url>
<developerConnection>scm:git:git@github.com:OpenCollabZA/epub-creator.git</developerConnection>
<tag>HEAD</tag>
</scm>
<connection>scm:git:git@github.com:kemitix/epub-creator.git</connection>
<url>scm:git:git@github.com:kemitix/epub-creator.git</url>
<developerConnection>scm:git:git@github.com:kemitix/epub-creator.git</developerConnection>
<tag>HEAD</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<tiles-maven-plugin.version>2.13</tiles-maven-plugin.version>
<kemitix-tiles.version>2.8.0</kemitix-tiles.version>
</properties>
<dependencies>
@ -47,51 +57,24 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>${tiles-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>net.kemitix.tiles:maven-plugins:${kemitix-tiles.version}</tile>
<tile>net.kemitix.tiles:enforcer:${kemitix-tiles.version}</tile>
<tile>net.kemitix.tiles:compiler-jdk-8:${kemitix-tiles.version}</tile>
<!-- <tile>net.kemitix.tiles:huntbugs:${kemitix-tiles.version}</tile>-->
<!-- <tile>net.kemitix.tiles:pmd:${kemitix-tiles.version}</tile>-->
<tile>net.kemitix.tiles:testing:${kemitix-tiles.version}</tile>
<!-- <tile>net.kemitix.tiles:coverage:${kemitix-tiles.version}</tile>-->
<!-- <tile>net.kemitix.tiles:pitest:${kemitix-tiles.version}</tile>-->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>opencollab-maven-public-releases</id>
<name>OPENCOLLAB public releases repository</name>
<url>https://nexus3.opencollab.co.za/repository/opencollab-maven-public-releases</url>
</repository>
<snapshotRepository>
<id>opencollab-maven-public-snapshots</id>
<name>OPENCOLLAB public snaphots repository</name>
<url>https://nexus3.opencollab.co.za/repository/opencollab-maven-public-snapshots</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>releases</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus-releases</serverId>
<nexusUrl>https://nexus3.opencollab.co.za/repository/opencollab-maven-public-releases</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View file

@ -1,97 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>coza.opencollab.epub</groupId>
<artifactId>epub-creator</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<scm>
<connection>scm:git:francois-opencollab@github.com:OpenCollabZA/epub-creator.git</connection>
<url>scm:git:francois-opencollab@github.com:OpenCollabZA/epub-creator.git</url>
<developerConnection>scm:git:francois-opencollab@github.com:OpenCollabZA/epub-creator.git</developerConnection>
<tag>HEAD</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlcleaner</groupId>
<artifactId>htmlcleaner</artifactId>
<version>2.8</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>opencollab-maven-public-releases</id>
<name>OPENCOLLAB public releases repository</name>
<url>https://nexus3.opencollab.co.za/repository/opencollab-maven-public-releases</url>
</repository>
<snapshotRepository>
<id>opencollab-maven-public-snapshots</id>
<name>OPENCOLLAB public snaphots repository</name>
<url>https://nexus3.opencollab.co.za/repository/opencollab-maven-public-snapshots</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>releases</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus-releases</serverId>
<nexusUrl>https://nexus3.opencollab.co.za/repository/opencollab-maven-public-releases</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View file

@ -1,18 +0,0 @@
#release configuration
#Wed Nov 06 00:48:36 SAST 2019
project.scm.coza.opencollab.epub\:epub-creator.tag=HEAD
project.scm.coza.opencollab.epub\:epub-creator.developerConnection=scm\:git\:git@github.com\:OpenCollabZA/epub-creator.git
scm.tagNameFormat=@{project.artifactId}-@{project.version}
project.scm.coza.opencollab.epub\:epub-creator.url=scm\:git\:git@github.com\:OpenCollabZA/epub-creator.git
scm.tag=epub-creator-1.0.1
pushChanges=true
scm.url=scm\:git\:git@github.com\:OpenCollabZA/epub-creator.git
preparationGoals=clean verify
remoteTagging=true
projectVersionPolicyId=default
scm.commentPrefix=[maven-release-plugin]
project.scm.coza.opencollab.epub\:epub-creator.connection=scm\:git\:git@github.com\:OpenCollabZA/epub-creator.git
project.dev.coza.opencollab.epub\:epub-creator=1.0.2-SNAPSHOT
project.rel.coza.opencollab.epub\:epub-creator=1.0.1
exec.snapshotReleasePluginAllowed=false
completedPhase=scm-commit-release