Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 49 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: Release

env:
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

on:
release:
types: [ published ]
Expand All @@ -16,20 +10,57 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Import GPG key
run: |
echo "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}" | gpg --batch --import
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf

- name: Install xmllint
run: sudo apt-get update && sudo apt-get install -y libxml2-utils

- name: Extract version from pom.xml
id: get_version
run: |
version=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" auto-generated-sdk/pom.xml)
echo "version=$version" >> $GITHUB_OUTPUT
if [[ "$version" == *SNAPSHOT* ]]; then
echo "is_snapshot=true" >> $GITHUB_OUTPUT
else
echo "is_snapshot=false" >> $GITHUB_OUTPUT
fi

- name: Set up JDK for snapshot repository
if: steps.get_version.outputs.is_snapshot == 'true'
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
server-id: central-portal-snapshots
server-username: MAVEN_PORTAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set up JDK
uses: actions/setup-java@v1
- name: Set up JDK for release repository
if: steps.get_version.outputs.is_snapshot == 'false'
uses: actions/setup-java@v4
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
java-version: '8'
distribution: 'temurin'
server-id: central
server-username: MAVEN_PORTAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build
run: mvn -B package --file auto-generated-sdk/pom.xml


- name: Build with Maven
run: mvn -B package --file auto-generated-sdk/pom.xml
- name: Publish to Apache Maven Central
run: cd auto-generated-sdk && mvn -Psign-artifacts verify deploy
env:
MAVEN_PORTAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
43 changes: 37 additions & 6 deletions auto-generated-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@
<artifactId>engines-sdk</artifactId>
<packaging>jar</packaging>
<name>engines-sdk</name>
<version>6.2.0</version>
<version>6.2.1</version>
<url>https://github.com/factset/analyticsapi-engines-java-sdk</url>
<description>SDK for FactSet Analytics Engines API</description>
<distributionManagement>
<snapshotRepository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</snapshotRepository>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<name>Central Portal Releases</name>
<id>central</id>
<url>https://central.sonatype.com</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</distributionManagement>
<scm>
Expand Down Expand Up @@ -91,6 +105,15 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<deploymentName>${project.groupId}-${project.artifactId}-${project.version}</deploymentName>
</configuration>
</plugin>

<!-- attach test jar -->
<plugin>
Expand Down Expand Up @@ -204,15 +227,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<configuration>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand All @@ -222,6 +245,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<configuration>
<publishingServerId>central</publishingServerId>
<waitUntil>validated</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
6 changes: 3 additions & 3 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.factset</groupId>
<artifactId>tests</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>

<build>
<plugins>
Expand Down Expand Up @@ -116,7 +116,7 @@
</dependency>
<dependency>
<scope>system</scope>
<systemPath>${project.basedir}/../auto-generated-sdk/target/engines-sdk-6.2.0.jar</systemPath>
<systemPath>${project.basedir}/../auto-generated-sdk/target/engines-sdk-6.2.1.jar</systemPath>
<groupId>com.factset.analyticsapi</groupId>
<artifactId>engines-sdk</artifactId>
<version>${engines-sdk-version}</version>
Expand All @@ -142,7 +142,7 @@
<junit-version>4.13.1</junit-version>
<protobuf-version>3.25.1</protobuf-version>
<stach-extension-version>1.6.0</stach-extension-version>
<engines-sdk-version>6.2.0</engines-sdk-version>
<engines-sdk-version>6.2.1</engines-sdk-version>
<poi-ooxml-version>4.0.1</poi-ooxml-version>
</properties>
</project>