Skip to content

Commit e224e37

Browse files
committed
ci: add support for package snapshot release java
1 parent d032537 commit e224e37

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Snapshot Release To Maven Central
2+
run-name: Publishing Snapshot Package Version ${{ github.event.inputs.Version }}-SNAPSHOT
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
Version:
8+
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version. Do not include -SNAPSHOT; it will be appended automatically by the workflow for snapshot releases."
9+
required: true
10+
11+
jobs:
12+
publish:
13+
name: Publish the Maven package
14+
runs-on: ubuntu-latest
15+
environment: Sandbox
16+
steps:
17+
- name: Check out git repository
18+
uses: actions/checkout@v2
19+
with:
20+
ref: ${{ github.ref_name }}
21+
22+
- name: Install Java and Maven setup
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 8
26+
27+
- name: Update version in POM
28+
run: mvn -B versions:set -DnewVersion=${{ github.event.inputs.Version }}-SNAPSHOT -DgenerateBackupPoms=false
29+
- name: Release to Maven Central
30+
id: release
31+
uses: samuelmeuli/action-maven-publish@v1
32+
with:
33+
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
34+
gpg_passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
35+
nexus_username: ${{ secrets.OSSRH_USERNAME }}
36+
nexus_password: ${{ secrets.OSSRH_PASSWORD }}

0 commit comments

Comments
 (0)