Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to GitHub Packages #1

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Maven CI

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# temurin LTS versions
version: [17, 21]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.version }}
distribution: 'temurin'
cache: maven
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Maven build
run: mvn --batch-mode --update-snapshots --fail-fast tidy:check com.mycila:license-maven-plugin:check com.github.spotbugs:spotbugs-maven-plugin:check verify
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
33 changes: 33 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven
# https://github.com/actions/setup-java
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
# using java 17 for now, to match original
# todo: migrate to java 21 (LTS)
java-version: 17
distribution: 'temurin'
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#extra-setup-for-pomxml
- name: Build with Maven
run: mvn --batch-mode package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy
env:
GITHUB_TOKEN: ${{ github.token }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

[Unreleased]: https://github.com/fairdevkit/rdf-resource-resolver/compare/master...HEAD
[Unreleased]: https://github.com/fairdatateam/rdf-resource-resolver/compare/master...HEAD
132 changes: 125 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
SOFTWARE.

-->
<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">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.fairdevkit</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<version>0.1.2-SNAPSHOT</version>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>

<licenses>
Expand All @@ -47,13 +47,24 @@

<distributionManagement>
<repository>
<id>nexus-snapshots</id>
<name>Nexus Snapshots</name>
<url>https://nexus.internal.fairdatapoint.org/repository/maven-snapshots/</url>
<!--
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#publishing-a-package -->
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<!--
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables -->
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
</repository>
</distributionManagement>

<properties>
<!-- DRY groupId (can be overridden by command line -DgroupId=... or env variable GROUP_ID) -->
<groupId>org.fairdatateam.rdf</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<!-- project version -->
<!-- https://maven.apache.org/maven-ci-friendly.html#multi-module-setup -->
<revision>0.1.2-SNAPSHOT</revision>

<!-- project settings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand All @@ -64,6 +75,7 @@
<!-- compile dependency version management -->
<slf4j.version>1.7.30</slf4j.version>
<rdf4j.version>3.7.0</rdf4j.version>
<flatten.version>1.6.0</flatten.version>
<!-- provided dependency version management -->
<spotbugs.version>4.2.3</spotbugs.version>
<!-- test dependency version management -->
Expand Down Expand Up @@ -102,6 +114,7 @@

<build>
<testSourceDirectory>src/test/groovy</testSourceDirectory>
<!-- TODO: the repo does not have any tests, so why do we have plugins for surefire, gmavenplus, groovy, spock, ...? -->
<pluginManagement>
<plugins>
<plugin>
Expand Down Expand Up @@ -149,6 +162,111 @@
</licenseSets>
</configuration>
</plugin>
<plugin><!-- required for deploying projects with ${revision} -->
<!-- https://maven.apache.org/maven-ci-friendly.html#install-deploy -->
<!-- https://www.mojohaus.org/flatten-maven-plugin/usage.html -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<!-- enable flattening -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<!-- ensure proper cleanup -->
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- the following plugins are required for publishing to maven central -->
<!-- https://central.sonatype.org/publish/publish-portal-maven/ -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>false</autoPublish>
</configuration>
</plugin>
<!-- https://central.sonatype.org/publish/publish-maven/#gpg-signed-components -->
<!-- https://maven.apache.org/plugins/maven-gpg-plugin/usage.html -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<bestPractices>true</bestPractices>
<!-- set gpg.keyname via command line if necessary (default: first found) -->
</configuration>
</execution>
</executions>
</plugin>
<!-- https://central.sonatype.org/publish/publish-maven/#javadoc-and-sources-attachments -->
<!-- https://maven.apache.org/plugins/maven-source-plugin/ -->
<!-- https://maven.apache.org/plugins/maven-javadoc-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.10.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<!-- override groupId property if GROUP_ID environment variable is found -->
<activation>
<property>
<name>env.GROUP_ID</name>
</property>
</activation>
<properties>
<groupId>${env.GROUP_ID}</groupId>
</properties>
</profile>
</profiles>
</project>
8 changes: 4 additions & 4 deletions rdf-resource-resolver-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
SOFTWARE.

-->
<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">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.fairdevkit</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<version>0.1.2-SNAPSHOT</version>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${revision}</version>
</parent>

<artifactId>rdf-resource-resolver-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.api;
package org.fairdatateam.rdf.resolver.api;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.api;
package org.fairdatateam.rdf.resolver.api;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
* API types for the RDF resolver library.
*/
@javax.annotation.ParametersAreNonnullByDefault
package com.github.fairdevkit.rdf.resolver.api;
package org.fairdatateam.rdf.resolver.api;
10 changes: 5 additions & 5 deletions rdf-resource-resolver-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
SOFTWARE.

-->
<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">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.fairdevkit</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<version>0.1.2-SNAPSHOT</version>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${revision}</version>
</parent>

<artifactId>rdf-resource-resolver-core</artifactId>

<dependencies>
<!-- compile -->
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>${groupId}</groupId>
<artifactId>rdf-resource-resolver-api</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.core;
package org.fairdatateam.rdf.resolver.core;

import com.github.fairdevkit.rdf.resolver.api.ResolverStrategy;
import org.fairdatateam.rdf.resolver.api.ResolverStrategy;
import java.io.IOException;
import java.io.InputStream;
import java.net.http.HttpClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.core;
package org.fairdatateam.rdf.resolver.core;

import java.io.InputStream;
import java.net.URI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.core;
package org.fairdatateam.rdf.resolver.core;

import com.github.fairdevkit.rdf.resolver.api.ResolverStrategy;
import com.github.fairdevkit.rdf.resolver.api.ResourceResolver;
import org.fairdatateam.rdf.resolver.api.ResolverStrategy;
import org.fairdatateam.rdf.resolver.api.ResourceResolver;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.core;
package org.fairdatateam.rdf.resolver.core;

import java.io.InputStream;
import java.net.URI;
Expand Down
Loading
Loading