Skip to content

Commit

Permalink
Push to sonatype (#16)
Browse files Browse the repository at this point in the history
* Push to sonatype

* No need to sign GPG in SNAPSHOT

* Report `-P release` for SNAPSHOT

* Update server params

* Test `Main CI (Release)` on dummy `0.0.1-SNAPSHOT` version

* [maven-release-plugin] prepare release aws-sdk-java-opentelemetry-metrics-0.0.1

* [maven-release-plugin] prepare for next development iteration

* Undo temp `RELEASE` in branch

* Add missing newline

* Bump plugins to latest version, verify release

* [maven-release-plugin] prepare release aws-sdk-java-opentelemetry-metrics-0.0.2

* [maven-release-plugin] prepare for next development iteration

* Remove test branch from release CI

* Test again, add `develops` section

* [maven-release-plugin] prepare release aws-sdk-java-opentelemetry-metrics-0.0.3

* [maven-release-plugin] prepare for next development iteration

* Add release profile

* [maven-release-plugin] prepare release aws-sdk-java-opentelemetry-metrics-0.0.4

* [maven-release-plugin] prepare for next development iteration

* Move `maven-gpg-plugin` under release

* Update CI

* [maven-release-plugin] prepare release aws-sdk-java-opentelemetry-metrics-0.0.5

* [maven-release-plugin] prepare for next development iteration

* Remove `deploy` on branch, use `1.0.0-SNAPSHOT`

---------

Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
evg-tso and GitHub Actions authored Sep 18, 2024
1 parent fbd06c2 commit 9015f23
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/branch_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ jobs:
java-version: '8'
distribution: 'corretto'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Grant execute permission for Maven Wrapper
run: chmod +x ./mvnw

- name: Deploy SNAPSHOT
run: ./mvnw --batch-mode -DskipTests -Darguments=-DskipTests deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
24 changes: 22 additions & 2 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ jobs:
java-version: '8'
distribution: 'corretto'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set GPG Key for Signing
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
echo "default-key ${GPG_KEY_ID}" >> ~/.gnupg/gpg.conf
echo "use-agent" >> ~/.gnupg/gpg.conf
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Set Git user for release
run: |
Expand All @@ -40,6 +54,12 @@ jobs:
- name: Bump Version and Release (Maven Release Plugin)
run: |
echo "Releasing and bumping version..."
./mvnw release:prepare release:perform -Darguments=-DskipTests -B
./mvnw \
-Darguments=-DskipTests \
-Dgpg.keyname=${{ secrets.GPG_KEY_ID }} \
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
release:prepare release:perform -B -P release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
52 changes: 41 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.appsflyer</groupId>
<artifactId>aws-sdk-java-opentelemetry-metrics</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<name>AWS SDK Java OpenTelemetry Metrics</name>
<description>OpenTelemetry Metric Publisher for AWS SDK for Java</description>
<url>https://github.com/AppsFlyer/aws-sdk-java-opentelemetry-metrics</url>
Expand All @@ -23,15 +23,23 @@
<tag>HEAD</tag>
</scm>

<developers>
<developer>
<id>evg-tso</id>
<name>Yevgeni Tsodikov</name>
<email>[email protected]</email>
</developer>
</developers>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<opentelemetry.version>1.24.0</opentelemetry.version>
<software.amazon.awssdk.version>2.27.23</software.amazon.awssdk.version>
<slf4j-api.version>2.0.7</slf4j-api.version>
<junit-jupiter.version>5.10.3</junit-jupiter.version>
<mockito-core.version>5.5.0</mockito-core.version>
<slf4j-api.version>2.0.16</slf4j-api.version>
<junit-jupiter.version>5.11.0</junit-jupiter.version>
<mockito-core.version>5.13.0</mockito-core.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -102,7 +110,7 @@
<!-- Maven Compiler Plugin for Java 8 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
Expand All @@ -125,14 +133,14 @@

<distributionManagement>
<snapshotRepository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/appsflyer/aws-sdk-java-opentelemetry-metrics</url>
<id>ossrh</id>
<name>OSSRH Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/appsflyer/aws-sdk-java-opentelemetry-metrics</url>
<id>ossrh</id>
<name>OSSRH Releases</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

Expand Down Expand Up @@ -176,6 +184,28 @@
</execution>
</executions>
</plugin>

<!-- GPG Plugin for signing artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit 9015f23

Please sign in to comment.