Skip to content

Commit 76e2a0e

Browse files
committed
publishing to maven central
1 parent 3630164 commit 76e2a0e

File tree

2 files changed

+89
-8
lines changed

2 files changed

+89
-8
lines changed

.github/workflows/maven-publish.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ jobs:
1919
with:
2020
java-version: '11'
2121
distribution: 'temurin'
22-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2322
settings-path: ${{ github.workspace }} # location for the settings.xml file
23+
server-id: central
24+
server-username: MAVEN_USERNAME # env variable for username in deploy
25+
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
26+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
27+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
2428

25-
- name: Build with Maven
26-
run: mvn -B package --file pom.xml
27-
28-
- name: Publish to GitHub Packages Apache Maven
29-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
29+
- name: Publish to Maven Central
30+
run: mvn clean deploy -s $GITHUB_WORKSPACE/settings.xml
3031
env:
3132
GITHUB_TOKEN: ${{ github.token }}
33+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
34+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,103 @@
66

77
<groupId>com.octopus.openfeature</groupId>
88
<artifactId>octopus-openfeature-provider</artifactId>
9-
<version>0.2.0</version>
9+
<version>0.3.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Octopus Deploy OpenFeature Provider</name>
1313
<description>The Octopus Deploy provider for OpenFeature</description>
1414
<url>https://octopus.com/docs/feature-toggles</url>
1515

16+
<licenses>
17+
<license>
18+
<name>Apache License, Version 2.0</name>
19+
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
20+
</license>
21+
</licenses>
22+
23+
<developers>
24+
<developer>
25+
<name>Michael Richardson</name>
26+
<email>[email protected]</email>
27+
<organization>Octopus Deploy</organization>
28+
<organizationUrl>https://octopus.com</organizationUrl>
29+
</developer>
30+
</developers>
31+
1632
<properties>
1733
<maven.compiler.source>11</maven.compiler.source>
1834
<maven.compiler.target>11</maven.compiler.target>
1935
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2036
</properties>
21-
37+
38+
<scm>
39+
<url>https://github.com/OctopusDeploy/openfeature-provider-java</url>
40+
</scm>
41+
42+
<build>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.sonatype.central</groupId>
46+
<artifactId>central-publishing-maven-plugin</artifactId>
47+
<version>0.8.0</version>
48+
<extensions>true</extensions>
49+
<configuration>
50+
<publishingServerId>central</publishingServerId>
51+
</configuration>
52+
</plugin>
53+
<plugin>
54+
<groupId>org.apache.maven.plugins</groupId>
55+
<artifactId>maven-source-plugin</artifactId>
56+
<version>3.3.1</version>
57+
<executions>
58+
<execution>
59+
<id>attach-sources</id>
60+
<phase>verify</phase>
61+
<goals>
62+
<goal>jar-no-fork</goal>
63+
</goals>
64+
</execution>
65+
</executions>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-javadoc-plugin</artifactId>
70+
<version>3.11.2</version>
71+
<executions>
72+
<execution>
73+
<id>attach-javadocs</id>
74+
<goals>
75+
<goal>jar</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-gpg-plugin</artifactId>
83+
<version>3.2.7</version>
84+
<executions>
85+
<execution>
86+
<id>sign-artifacts</id>
87+
<phase>verify</phase>
88+
<goals>
89+
<goal>sign</goal>
90+
</goals>
91+
</execution>
92+
</executions>
93+
</plugin>
94+
</plugins>
95+
</build>
96+
97+
<!--
2298
<distributionManagement>
2399
<repository>
24100
<id>github</id>
25101
<name>GitHub Packages</name>
26102
<url>https://maven.pkg.github.com/OctopusDeploy/openfeature-provider-java</url>
27103
</repository>
28104
</distributionManagement>
105+
-->
29106

30107
<dependencies>
31108
<dependency>

0 commit comments

Comments
 (0)