Skip to content

Commit

Permalink
feat: publish jvm artifacts (#2640)
Browse files Browse the repository at this point in the history
Closes #2636

---------

Co-authored-by: Moe Jangda <[email protected]>
Co-authored-by: Stuart Douglas <[email protected]>
  • Loading branch information
3 people authored Sep 11, 2024
1 parent eb2722b commit 7a7e8d0
Show file tree
Hide file tree
Showing 3 changed files with 273 additions and 2 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
docker tag ftl0/ftl-box:latest ftl0/ftl-box:"$GITHUB_SHA"
docker tag ftl0/ftl-box:latest ftl0/ftl-box:"$version"
docker push -a ftl0/ftl-box
create-release:
create-go-release:
name: Release Go Binaries
runs-on: ubuntu-latest
steps:
Expand All @@ -136,10 +136,47 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
FTL_HOMEBREW_TOKEN: ${{ secrets.FTL_HOMEBREW_TOKEN }}
create-jvm-releases:
name: Release JVM Artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/activate-hermit@v1

- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set Version
working-directory: ./jvm-runtime/ftl-runtime
run: mvn versions:set -DnewVersion=${{ github.ref_name }}

- name: Build, Test, and Deploy to Maven Central
working-directory: ./jvm-runtime/ftl-runtime
run: |
# Maven deploy lifecycle will build, run tests, verify, sign, and deploy
mvn \
deploy \
-P ossrh,release \
--batch-mode \
--settings .maven_settings.xml
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGN_KEY_PASS: ${{ secrets.GPG_SECRET_PASSPHRASE }}
SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }}

hermit-release:
name: Release Hermit
runs-on: ubuntu-latest
needs: [create-release]
needs: [create-go-release]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
95 changes: 95 additions & 0 deletions jvm-runtime/ftl-runtime/.maven_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<settings>
<servers>
<server>
<id>tbd-oss-releases</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>tbd-oss-snapshots</id>
<username>${env.ARTIFACTORY_USERNAME}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>ossrh-snapshots</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
<id>ossrh-releases</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>

<profiles>
<profile>
<id>tbd-internal</id>
<!-- specifies where the project artifacts should be distributed or deployed.
tells Maven where to deploy your project's artifacts when you run mvn deploy -->
<distributionManagement>
<!-- primary release repository. not being used yet -->
<repository>
<uniqueVersion>false</uniqueVersion>
<id>tbd-oss-releases</id>
<name>TBD OSS Releases Repository</name>
<url>https://blockxyz.jfrog.io/artifactory/tbd-oss-releases-maven2</url>
<layout>default</layout>
</repository>
<!-- primary snapshot repository for all "*-SNAPSHOT" artifacts. not yet being used -->
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>tbd-oss-snapshots</id>
<name>TBD OSS Snapshots Repository</name>
<url>https://blockxyz.jfrog.io/artifactory/tbd-oss-snapshots-maven2</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>

<!-- additional repositories that we can pull dependencies from -->
<repositories>
<!-- mirror for all third-party dependencies. acts as a redundancy that we can failover to if third-party deps become
unavailable -->
<repository>
<id>tbd-oss-thirdparty</id>
<name>tbd-oss-thirdparty</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://blockxyz.jfrog.io/artifactory/tbd-oss-thirdparty-maven2/</url>
</repository>
<!-- snapshot repository. -->
<repository>
<id>tbd-oss-snapshots</id>
<name>tbd-oss-snapshots</name>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://blockxyz.jfrog.io/artifactory/tbd-oss-snapshots-maven2/</url>
</repository>
</repositories>

<!-- additional repositories that we can pull plugins from -->
<pluginRepositories>
<pluginRepository>
<id>tbd-oss-thirdparty</id>
<name>tbd-oss-thirdparty</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://blockxyz.jfrog.io/artifactory/tbd-oss-thirdparty-maven2/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

</settings>
139 changes: 139 additions & 0 deletions jvm-runtime/ftl-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Ftl Java Runtime - Parent</name>
<description>Towards a 𝝺-calculus for large-scale systems</description>
<url>https://tbd54566975.github.io/ftl/</url>

<scm>
<connection>scm:git:git://github.com/TBD54566975/ftl.git</connection>
<!-- This has to be HTTPS, not git://, for maven-release-plugin to do AUTH correctly -->
<developerConnection>scm:git:https://github.com/TBD54566975/ftl.git</developerConnection>
<url>https://github.com/TBD54566975/ftl</url>
<tag>HEAD</tag>
</scm>

<developers>
<developer>
<id>TBD54566975</id>
<name>Block, Inc.</name>
<email>[email protected]</email>
</developer>
</developers>

<issueManagement>
<system>github</system>
<url>https://github.com/TBD54566975/ftl/issues</url>
</issueManagement>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<modules>
<module>common</module>
Expand Down Expand Up @@ -207,8 +238,47 @@
<artifactId>quarkus-extension-maven-plugin</artifactId>
<version>${quarkus.version}</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<deployAtEnd>true</deployAtEnd>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.simplify4u.plugins</groupId>
<artifactId>sign-maven-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- handles the deployment of the project's artifacts to a remote repository -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>


Expand Down Expand Up @@ -293,5 +363,74 @@
</plugins>
</build>
</profile>

<profile>
<!-- Profile for releasing artifacts to Maven Central -->
<id>release</id>
<build>
<plugins>
<!-- produce signed artifacts -->
<plugin>
<groupId>org.simplify4u.plugins</groupId>
<artifactId>sign-maven-plugin</artifactId>
</plugin>
<!-- generates a JAR file containing the source code of the project -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>1.9.20</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>javadocJar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- used to deploy artifacts to Maven Central via OSSRH (OSS Repository Hosting).
It configures the nexus-staging-maven-plugin for automated deployment and release,
and sets up the distribution management for both snapshot and release repositories.
Activate this profile when deploying open-source projects to Maven Central. -->
<profile>
<!-- https://central.sonatype.org/publish/publish-maven/#deployment -->
<id>ossrh</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh-releases</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<!-- specifies where the project artifacts should be distributed or deployed. -->
<!-- tells Maven where to deploy your project's artifacts when you run mvn deploy -->
<distributionManagement>
<snapshotRepository>
<id>ossrh-snapshots</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<!-- Sonatype's OSSRH - replicates to Maven Central within 30min of publish -->
<repository>
<id>ossrh-releases</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>

</project>

0 comments on commit 7a7e8d0

Please sign in to comment.