Skip to content

Commit 03167c0

Browse files
chore(release): central portal (#94)
1 parent 5947edf commit 03167c0

File tree

3 files changed

+89
-27
lines changed

3 files changed

+89
-27
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Release
22

3-
env:
4-
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
6-
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
7-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
8-
93
on:
104
release:
115
types: [ published ]
@@ -16,20 +10,57 @@ jobs:
1610
runs-on: ubuntu-latest
1711

1812
steps:
19-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
14+
15+
- name: Import GPG key
16+
run: |
17+
echo "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}" | gpg --batch --import
18+
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
19+
20+
- name: Install xmllint
21+
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
22+
23+
- name: Extract version from pom.xml
24+
id: get_version
25+
run: |
26+
version=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" auto-generated-sdk/pom.xml)
27+
echo "version=$version" >> $GITHUB_OUTPUT
28+
if [[ "$version" == *SNAPSHOT* ]]; then
29+
echo "is_snapshot=true" >> $GITHUB_OUTPUT
30+
else
31+
echo "is_snapshot=false" >> $GITHUB_OUTPUT
32+
fi
33+
34+
- name: Set up JDK for snapshot repository
35+
if: steps.get_version.outputs.is_snapshot == 'true'
36+
uses: actions/setup-java@v4
37+
with:
38+
java-version: '8'
39+
distribution: 'temurin'
40+
server-id: central-portal-snapshots
41+
server-username: MAVEN_PORTAL_USERNAME
42+
server-password: MAVEN_CENTRAL_TOKEN
43+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
44+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2045

21-
- name: Set up JDK
22-
uses: actions/setup-java@v1
46+
- name: Set up JDK for release repository
47+
if: steps.get_version.outputs.is_snapshot == 'false'
48+
uses: actions/setup-java@v4
2349
with:
24-
java-version: 1.8
25-
server-id: ossrh
26-
server-username: MAVEN_USERNAME
27-
server-password: MAVEN_PASSWORD
28-
gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
50+
java-version: '8'
51+
distribution: 'temurin'
52+
server-id: central
53+
server-username: MAVEN_PORTAL_USERNAME
54+
server-password: MAVEN_CENTRAL_TOKEN
55+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2956
gpg-passphrase: MAVEN_GPG_PASSPHRASE
30-
31-
- name: Build
32-
run: mvn -B package --file auto-generated-sdk/pom.xml
33-
57+
58+
- name: Build with Maven
59+
run: mvn -B package --file auto-generated-sdk/pom.xml
60+
3461
- name: Publish to Apache Maven Central
3562
run: cd auto-generated-sdk && mvn -Psign-artifacts verify deploy
63+
env:
64+
MAVEN_PORTAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
65+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
66+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

auto-generated-sdk/pom.xml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,28 @@
55
<artifactId>engines-sdk</artifactId>
66
<packaging>jar</packaging>
77
<name>engines-sdk</name>
8-
<version>6.2.0</version>
8+
<version>6.2.1</version>
99
<url>https://github.com/factset/analyticsapi-engines-java-sdk</url>
1010
<description>SDK for FactSet Analytics Engines API</description>
1111
<distributionManagement>
12+
<snapshotRepository>
13+
<name>Central Portal Snapshots</name>
14+
<id>central-portal-snapshots</id>
15+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
16+
<releases>
17+
<enabled>false</enabled>
18+
</releases>
19+
<snapshots>
20+
<enabled>true</enabled>
21+
</snapshots>
22+
</snapshotRepository>
1223
<repository>
13-
<id>ossrh</id>
14-
<name>Central Repository OSSRH</name>
15-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
24+
<name>Central Portal Releases</name>
25+
<id>central</id>
26+
<url>https://central.sonatype.com</url>
27+
<releases>
28+
<enabled>true</enabled>
29+
</releases>
1630
</repository>
1731
</distributionManagement>
1832
<scm>
@@ -91,6 +105,15 @@
91105
</execution>
92106
</executions>
93107
</plugin>
108+
<plugin>
109+
<groupId>org.sonatype.central</groupId>
110+
<artifactId>central-publishing-maven-plugin</artifactId>
111+
<version>0.8.0</version>
112+
<extensions>true</extensions>
113+
<configuration>
114+
<deploymentName>${project.groupId}-${project.artifactId}-${project.version}</deploymentName>
115+
</configuration>
116+
</plugin>
94117

95118
<!-- attach test jar -->
96119
<plugin>
@@ -204,15 +227,15 @@
204227
<plugin>
205228
<groupId>org.apache.maven.plugins</groupId>
206229
<artifactId>maven-gpg-plugin</artifactId>
207-
<version>1.6</version>
230+
<version>3.2.8</version>
208231
<executions>
209232
<execution>
210233
<id>sign-artifacts</id>
211234
<phase>verify</phase>
212235
<goals>
213236
<goal>sign</goal>
214237
</goals>
215-
<configuration>
238+
<configuration>
216239
<!-- Prevent gpg from using pinentry programs -->
217240
<gpgArguments>
218241
<arg>--pinentry-mode</arg>
@@ -222,6 +245,14 @@
222245
</execution>
223246
</executions>
224247
</plugin>
248+
<plugin>
249+
<groupId>org.sonatype.central</groupId>
250+
<artifactId>central-publishing-maven-plugin</artifactId>
251+
<configuration>
252+
<publishingServerId>central</publishingServerId>
253+
<waitUntil>validated</waitUntil>
254+
</configuration>
255+
</plugin>
225256
</plugins>
226257
</build>
227258
</profile>

tests/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>com.factset</groupId>
55
<artifactId>tests</artifactId>
6-
<version>0.0.1</version>
6+
<version>0.0.2</version>
77

88
<build>
99
<plugins>
@@ -116,7 +116,7 @@
116116
</dependency>
117117
<dependency>
118118
<scope>system</scope>
119-
<systemPath>${project.basedir}/../auto-generated-sdk/target/engines-sdk-6.2.0.jar</systemPath>
119+
<systemPath>${project.basedir}/../auto-generated-sdk/target/engines-sdk-6.2.1.jar</systemPath>
120120
<groupId>com.factset.analyticsapi</groupId>
121121
<artifactId>engines-sdk</artifactId>
122122
<version>${engines-sdk-version}</version>
@@ -142,7 +142,7 @@
142142
<junit-version>4.13.1</junit-version>
143143
<protobuf-version>3.25.1</protobuf-version>
144144
<stach-extension-version>1.6.0</stach-extension-version>
145-
<engines-sdk-version>6.2.0</engines-sdk-version>
145+
<engines-sdk-version>6.2.1</engines-sdk-version>
146146
<poi-ooxml-version>4.0.1</poi-ooxml-version>
147147
</properties>
148148
</project>

0 commit comments

Comments
 (0)