Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
61ffe25
wip
raboof Jun 23, 2021
bc1fd64
Sign artifacts
raboof Jun 23, 2021
2f8836b
Deploy the maven plugin specifically
raboof Jun 23, 2021
e8098af
Add sonatype credentials
raboof Jun 23, 2021
d997f50
Add gpg key and passphrase
raboof Jun 23, 2021
ccaaf89
consistent ci job name
raboof Jun 23, 2021
77b6eda
Escape '<<'
raboof Jun 23, 2021
e478997
Create temporary key for local artifacts
raboof Jun 23, 2021
7dd9d21
Invalid option: --pinentry-mode
raboof Jun 24, 2021
18b8bf9
explicitly invoke gpg2?
raboof Jun 24, 2021
526ee42
get gpg version
raboof Jun 24, 2021
a5d0e2c
gpg2
raboof Jun 24, 2021
9069a4e
sudo apt-get
raboof Jun 24, 2021
46cb2b5
First update
raboof Jun 24, 2021
5b4d6e3
Get version
raboof Jun 24, 2021
f08e0c0
don't set pinentry-mode
raboof Jun 24, 2021
c482734
--gen-key
raboof Jun 24, 2021
d40934d
Test publishing maven plugin from branch
raboof Jun 24, 2021
a5fa39f
No distributionManagement for sub-pom?
raboof Jun 24, 2021
683a3c2
Make sure ~/.m2, including the deps cache, is available
raboof Jun 24, 2021
1f1aba0
Create ~/.m2 if it does not exist yet
raboof Jun 24, 2021
061ab80
Add missing </settings>
raboof Jun 24, 2021
de2c035
Fix type in SDK_VERSION env var
raboof Jun 24, 2021
966a351
Avoid 'gpg: signing failed: Inappropriate ioctl for device'
raboof Jun 24, 2021
60e2fce
export?
raboof Jun 24, 2021
239c6e7
Set passphrase with env var as well?
raboof Jun 24, 2021
c61e866
Maybe --batch avoids pinentry?
raboof Jun 24, 2021
ea11f95
gpg versions
raboof Jun 24, 2021
cb284c5
pinentry loopback after all?
raboof Jun 24, 2021
142a495
Roll back gpg version changes that I now think were unneeded
raboof Jun 24, 2021
75cb91a
Cleaning up
raboof Jun 24, 2021
e255da4
Configure signing in profile
raboof Jun 24, 2021
694e2f4
Only sign when releasing
raboof Jun 24, 2021
ca45c8d
Less gpg config needed for tests
raboof Jun 24, 2021
afcf8ef
Publish all submodules in one go
raboof Jun 24, 2021
356504b
Enable nexus-staging-maven-plugin for all 3 maven projects
raboof Jun 24, 2021
c4be131
Only deploy the submodules
raboof Jun 24, 2021
8d03b51
Add requirements to circleci again
raboof Jun 24, 2021
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
54 changes: 54 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,46 @@ jobs:
- run: sbt ci-release
- save_deps_cache

publish-maven:
docker:
- image: circleci/openjdk:8
steps:
- checkout
- restore_deps_cache
- set-sdk-version
- run:
name: Publish maven plugin and archetype
command: |
cd maven-java
echo $PGP_SECRET | base64 -d | gpg --import --batch
# It seems ~/.m2 is not actually restored from the cache?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to investigate it further. We may be doing something wrong.

When I was bringing the maven code here, I was surprised to see that I have to call sbt publishM2 more then once in the same CI build. I was planning to call only once and reuse the local artifacts on the next jobs. Didn't work as expected.

mkdir -p ~/.m2
cat >~/.m2/settings.xml \<<EOF;
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>$SONATYPE_USERNAME</username>
<password>$SONATYPE_PASSWORD</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.passphrase>$PGP_PASSPHRASE</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
EOF
mvn -B versions:set -DnewVersion=$SDK_VERSION
mvn -P release -B deploy

publish-tck:
docker:
- image: circleci/openjdk:11
Expand Down Expand Up @@ -302,6 +342,20 @@ workflows:
- samples-tests
- tck-tests
- validate-docs
- publish-maven:
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- checks
- tests
- integration-tests
- maven-java-tests
- samples-tests
- tck-tests
- validate-docs
- publish-tck:
filters: # version tags only
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
</resources>

<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
</resources>

<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
12 changes: 4 additions & 8 deletions maven-java/akkaserverless-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@

<name>Akka Serverless Maven Plugin</name>

<distributionManagement>
<repository>
<id>lightbend-akkaserverless-cloudsmith</id>
<name>Cloudsmith</name>
<url>https://maven.cloudsmith.io/lightbend/akkaserverless/</url>
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -132,6 +124,10 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
Expand Down
95 changes: 75 additions & 20 deletions maven-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.akkaserverless</groupId>
<artifactId>akkaserverless-maven-java</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<url>https://www.lightbend.com/akka-serverless</url>
<url>https://www.lightbend.com/akkaserverless</url>
<scm>
<url>https://github.com/lightbend/akkaserverless-maven-java</url>
<url>https://github.com/lightbend/akkaserverless-java-sdk</url>
</scm>

<developers>
Expand Down Expand Up @@ -46,34 +46,89 @@
</repositories>

<distributionManagement>
<repository>
<id>lightbend-akkaserverless-cloudsmith</id>
<name>Cloudsmith</name>
<url>https://maven.cloudsmith.io/lightbend/akkaserverless/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could set this to 'true' eventually, but for the first release perhaps let's give ourselves a chance to check the artifacts?

</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<!--
this plugin allow us to change the version of this projects and submodules
we use it in CI to align the project with the current SDK version
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
<inherited>false</inherited>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<!--
Needed on gpg 2.2 to avoid using the TTY
to ask for the password.
-->
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<modules>
<module>akkaserverless-maven-plugin</module>
<module>akkaserverless-maven-archetype-value-entity</module>
Expand Down