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 579e23b
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 37 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 }}
1 change: 1 addition & 0 deletions kotlin-runtime/ftl-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
</build>

<distributionManagement>
<!-- Central Repository -->
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
Expand Down
1 change: 1 addition & 0 deletions kotlin-runtime/ftl-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
</build>

<distributionManagement>
<!-- Central Repository -->
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
Expand Down
80 changes: 56 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,37 +270,27 @@
</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>
<build>
<plugins>
<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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -313,12 +303,54 @@
<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>
<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>
</profile>
Expand Down

0 comments on commit 579e23b

Please sign in to comment.