Skip to content

Commit

Permalink
debugging release.yml to publish JARs
Browse files Browse the repository at this point in the history
  • Loading branch information
worstell committed Nov 16, 2023
1 parent b486a2d commit dc78409
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 63 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ jobs:
name: Release JARs
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
contents: read
packages: write
steps:
- name: Checkout code
Expand All @@ -104,19 +103,20 @@ jobs:
with:
java-version: "11"
distribution: "temurin"
- name: Publish JARs
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-passphrase: SIGN_KEY_PASS
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
cache: 'maven'
- name: Publish JARs # release JARs to central
run: |
git config user.name github-actions
git config user.email [email protected]
mvn release:clean release:prepare release:perform \
--batch-mode \
-DreleaseVersion=$(git describe --tags --abbrev=0 | cut -c2-) \
-Dtag=$(git describe --tags --abbrev=0) \
-Dsonatype.username=${{ secrets.SONATYPE_USERNAME }} \
-Dsonatype.password=${{ secrets.SONATYPE_PASSWORD }} \
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
-DserverId=ossrh
mvn --batch-mode versions:set -DnewVersion=$(git describe --tags --abbrev=0 | cut -c2-) -DprocessAllModules -DgenerateBackupPoms=false
mvn -U --batch-mode clean deploy -P release
env:
SIGN_KEY_PASS: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GITHUB_TOKEN: ${{ github.token }}
create-release:
name: Release Go Binaries
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- main
name: Publish Snapshots
jobs:
release-jars:
name: Release JARs
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/activate-hermit@v1
# Ideally we'd use Hermit's JDK, but this action creates the correct settings.xml for us.
- uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-passphrase: SIGN_KEY_PASS
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
cache: 'maven'
- name: Publish Snapshot JARs
run: |
mvn --batch-mode versions:set -DnewVersion=$(git describe --tags --abbrev=0 | cut -c2-)-SNAPSHOT -DprocessAllModules -DgenerateBackupPoms=false
mvn -U --batch-mode clean deploy -P snapshot
env:
SIGN_KEY_PASS: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GITHUB_TOKEN: ${{ github.token }}
11 changes: 0 additions & 11 deletions kotlin-runtime/ftl-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,4 @@
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
11 changes: 0 additions & 11 deletions kotlin-runtime/ftl-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,4 @@
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
112 changes: 84 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

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

<scm>
<connection>scm:git:git://github.com/TBD54566975/ftl.git</connection>
<developerConnection>scm:git:ssh://github.com/TBD54566975/ftl.git</developerConnection>
<url>https://github.com/TBD54566975/ftl/tree/main</url>
</scm>

<modules>
<module>kotlin-runtime/ftl-runtime</module>
<module>kotlin-runtime/ftl-generator</module>
Expand Down Expand Up @@ -121,10 +134,6 @@
</dependency>
</dependencies>

<scm>
<developerConnection>scm:git:https://github.com/TBD54566975/ftl.git</developerConnection>
</scm>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -270,37 +279,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<!-- Release profile (required so these plugins are only used when releasing) -->
<id>release</id>
<modules>
<module>kotlin-runtime/ftl-runtime</module>
<module>kotlin-runtime/ftl-generator</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<releaseProfiles>release,release-profile</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -313,14 +315,68 @@
<goal>sign</goal>
</goals>
<configuration>
<keyname>0x088BCD86</keyname>
<passphraseServerId>gpg.passphrase</passphraseServerId>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
<arg>--keyserver</arg>
<arg>hkp://keys.openpgp.org/</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</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-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.2</version>
<inherited>true</inherited>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<skipNexusStagingDeployMojo>${maven.deploy.skip}</skipNexusStagingDeployMojo>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<!-- Central Repository -->
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>

0 comments on commit dc78409

Please sign in to comment.