Skip to content

Commit

Permalink
Release mechanism (including groupid transition) (danfickle#20)
Browse files Browse the repository at this point in the history
* Change groupid to reflect the transition into organization

* Doing builds and especially releases both on push and PR leads into duplicate builds. We should choose on of them, and I think PR should suffice

* Release process (danfickle#21)

* The first commit in the repo is from 2004, so I find it correct to state that as the inception year

* Updated the Maven compiler plugin as well

* Updated the Maven source and javadocs plugins

* Minor tweaks

* First take on a release pipeline

* Getting there

* Switching to using semver instead

* Updated groupid to adhere with what Maven central expects and accepts
  • Loading branch information
madsop-nav authored Apr 24, 2024
1 parent 7a947ed commit b968a4a
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: build

on: [push, pull_request]
on: [pull_request]

jobs:
build:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: build

on:
push:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
java: ['8','11','17', '21']

steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{matrix.java}}
cache: maven
- name: Maven -v
run: mvn -v
- name: Build with Maven
run: mvn -B package --file pom.xml

release:
name: Create release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
if: github.ref == 'refs/heads/main'
steps:
- name: Step 1 - Checkout code
uses: actions/checkout@v4
- name: Step 2 - Import GPG key
run: |
echo "${{ secrets.GPG_PUBLIC_KEY }}" | gpg --import
echo "${{ secrets.GPG_SECRET_KEY }}" | gpg --import --no-tty --batch --yes
- name: Step 3 - Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: maven
server-id: maven
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Step 4 - Get next version
uses: reecetech/version-increment@2023.9.3
id: version
with:
scheme: semver
increment: patch
- name: Step 5 - Prepare and perform release
run: mvn -B deploy -Drevision=${{ ${{ steps.version.outputs.version }}
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion openhtmltopdf-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down
18 changes: 9 additions & 9 deletions openhtmltopdf-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand All @@ -30,22 +30,22 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-pdfbox</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-rtl-support</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-svg-support</artifactId>
<version>${project.version}</version>
</dependency>
Expand All @@ -60,22 +60,22 @@
<version>${open.rhino.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-mathml-support</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-java2d</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-objects</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-latex-support</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions openhtmltopdf-java2d/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -54,7 +54,7 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions openhtmltopdf-latex-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -54,12 +54,12 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-mathml-support</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions openhtmltopdf-mathml-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -57,12 +57,12 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-svg-support</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions openhtmltopdf-objects/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -75,7 +75,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-pdfbox</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions openhtmltopdf-pdfa-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand All @@ -25,12 +25,12 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-pdfbox</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions openhtmltopdf-pdfbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -82,7 +82,7 @@
<version>${pdfbox.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions openhtmltopdf-rtl-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -59,7 +59,7 @@
<version>59.1</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions openhtmltopdf-slf4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -68,13 +68,13 @@
</dependency>

<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-pdfbox</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Expand Down
4 changes: 2 additions & 2 deletions openhtmltopdf-svg-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand Down Expand Up @@ -54,7 +54,7 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-core</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions openhtmltopdf-templates/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-parent</artifactId>
<version>${revision}</version>
</parent>
Expand All @@ -25,12 +25,12 @@

<dependencies>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-pdfbox</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>at.datenwort.openhtmltopdf</groupId>
<groupId>io.github.openhtmltopdf</groupId>
<artifactId>openhtmltopdf-svg-support</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
Loading

0 comments on commit b968a4a

Please sign in to comment.