-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added workflow to publish release
- Loading branch information
Showing
2 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build and Publish Release to OSSRH | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseVersion: | ||
description: "Version to use when preparing a release." | ||
required: true | ||
default: "X.Y.Z" | ||
developmentVersion: | ||
description: "Version to use for new local working copy." | ||
required: true | ||
default: "X.Y.Z-SNAPSHOT" | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: maven | ||
server-id: ossrh | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
gpg-passphrase: OSSRH_GPG_SECRET_KEY_PASSWORD | ||
- name: Configure Git user | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "GitHub Actions" | ||
- name: Build, Release and Publish to OSSRH | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | ||
run: | | ||
mvn -DreleaseVersion=${inputs.releaseVersion} -DdevelopmentVersion=${inputs.developmentVersion} --no-transfer-progress --batch-mode release:prepare release:perform -Dpublish=true | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
- name: Push tags | ||
uses: ad-m/[email protected] | ||
with: | ||
branch: ${{ github.ref }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,9 +40,10 @@ | |
</properties> | ||
|
||
<scm> | ||
<connection>scm:git:git://github.com/bekoenig/getdown.git</connection> | ||
<connection>scm:git:git@github.com:bekoenig/getdown.git</connection> | ||
<developerConnection>scm:git:[email protected]:bekoenig/getdown.git</developerConnection> | ||
<url>https://github.com/bekoenig/getdown</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<modules> | ||
|
@@ -56,6 +57,10 @@ | |
<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> | ||
|
||
<dependencyManagement> | ||
|
@@ -197,9 +202,10 @@ | |
<artifactId>maven-release-plugin</artifactId> | ||
<version>3.0.1</version> | ||
<configuration> | ||
<localCheckout>true</localCheckout> | ||
<pushChanges>false</pushChanges> | ||
<autoVersionSubmodules>true</autoVersionSubmodules> | ||
<tagNameFormat>@{project.version}</tagNameFormat> | ||
<goals>deploy</goals> | ||
</configuration> | ||
</plugin> | ||
|
||
|
@@ -211,6 +217,7 @@ | |
<configuration> | ||
<serverId>ossrh</serverId> | ||
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl> | ||
<autoReleaseAfterClose>true</autoReleaseAfterClose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|