Skip to content

Commit ad911ca

Browse files
committed
Add deployment parts for Maven Central
1 parent de70196 commit ad911ca

File tree

2 files changed

+125
-9
lines changed

2 files changed

+125
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy PathExpression
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
deployment:
7+
runs-on: ubuntu-latest
8+
name: PathExpression deployment
9+
steps:
10+
- name: Checkout source code
11+
uses: actions/checkout@v3
12+
# Sets up Java version
13+
- name: Set up Java
14+
uses: actions/setup-java@v3
15+
with:
16+
distribution: 'adopt'
17+
java-package: 'jdk'
18+
java-version: '11'
19+
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
20+
server-username: OSSRH_USERNAME # Env var that holds your OSSRH user name
21+
server-password: OSSRH_PASSWORD # Env var that holds your OSSRH user pw
22+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret
23+
gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase
24+
# Sets up Maven version
25+
- name: Set up Maven
26+
uses: stCarolas/setup-maven@v4.5
27+
with:
28+
maven-version: 3.6.3
29+
- name: Build & Deploy PathExpression
30+
run: mvn -B -U clean deploy -Pdeployment
31+
env:
32+
SIGN_KEY_PASS: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
33+
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
34+
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PW }}

pom.xml

Lines changed: 91 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,90 @@
33
<groupId>de.fraunhofer.iem</groupId>
44
<artifactId>pathexpression</artifactId>
55
<version>1.0.1</version>
6+
7+
<licenses>
8+
<license>
9+
<name>Eclipse Public License - v2.0</name>
10+
<url>https://www.eclipse.org/legal/epl-2.0/</url>
11+
</license>
12+
</licenses>
13+
14+
<scm>
15+
<connection>scm:git:${project.scm.url}</connection>
16+
<developerConnection>scm:git:${project.scm.url}</developerConnection>
17+
<url>git@github.com:johspaeth/PathExpression.git</url>
18+
<tag>${project.version}</tag>
19+
</scm>
20+
<description>Implementation of an algorithm by Tarjan that efficiently computes path expressions based on a labeled graph</description>
21+
<url>https://github.com/johspaeth/PathExpression</url>
22+
23+
<developers>
24+
<developer>
25+
<name>Johannes Spaeth</name>
26+
<email>johannes.spaeth@codeshield.de</email>
27+
<organization>CodeShield GmbH</organization>
28+
<organizationUrl>https://codeshield.de/</organizationUrl>
29+
</developer>
30+
</developers>
31+
32+
<profiles>
33+
<!-- This profile is used to avoid running the deployment in non-deployment
34+
contexts because they require specific keys from the Github remote. Include
35+
this profile by setting the -Pdeployment flag. -->
36+
<profile>
37+
<id>deployment</id>
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.sonatype.plugins</groupId>
42+
<artifactId>nexus-staging-maven-plugin</artifactId>
43+
<version>1.6.13</version>
44+
<extensions>true</extensions>
45+
<configuration>
46+
<serverId>ossrh</serverId>
47+
<nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
48+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
49+
</configuration>
50+
</plugin>
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-source-plugin</artifactId>
54+
<version>3.2.1</version>
55+
<executions>
56+
<execution>
57+
<id>attach-source</id>
58+
<goals>
59+
<goal>jar</goal>
60+
</goals>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
<plugin>
65+
<groupId>org.apache.maven.plugins</groupId>
66+
<artifactId>maven-gpg-plugin</artifactId>
67+
<version>3.0.1</version>
68+
<executions>
69+
<execution>
70+
<id>sign-artifacts</id>
71+
<phase>verify</phase>
72+
<goals>
73+
<goal>sign</goal>
74+
</goals>
75+
<configuration>
76+
<gpgArguments>
77+
<arg>--pinentry-mode</arg>
78+
<arg>loopback</arg>
79+
</gpgArguments>
80+
</configuration>
81+
</execution>
82+
</executions>
83+
</plugin>
84+
</plugins>
85+
</build>
86+
</profile>
87+
</profiles>
88+
89+
690
<build>
791
<plugins>
892
<plugin>
@@ -19,12 +103,7 @@
19103
</plugin>
20104
</plugins>
21105
</build>
22-
<scm>
23-
<connection>scm:git:${project.scm.url}</connection>
24-
<developerConnection>scm:git:${project.scm.url}</developerConnection>
25-
<url>git@github.com:johspaeth/PathExpression.git</url>
26-
<tag>${project.version}</tag>
27-
</scm>
106+
28107
<dependencies>
29108
<dependency>
30109
<groupId>com.google.guava</groupId>
@@ -45,10 +124,13 @@
45124
</dependencies>
46125

47126
<distributionManagement>
127+
<snapshotRepository>
128+
<id>ossrh</id>
129+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
130+
</snapshotRepository>
48131
<repository>
49-
<id>github</id>
50-
<name>GitHub Packages</name>
51-
<url>https://maven.pkg.github.com/johspaeth/PathExpression</url>
132+
<id>ossrh</id>
133+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
52134
</repository>
53135
</distributionManagement>
54136
</project>

0 commit comments

Comments
 (0)