Skip to content

Commit 060c5ae

Browse files
committed
ci(snapshot-release): add snapshot package release to the github workflow
This commit adds a workflow file for the snapshot release to the core library and also overrides the deployment name for the release to maven central.
1 parent 77ad760 commit 060c5ae

2 files changed

Lines changed: 37 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: Production
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 }}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
<tokenAuth>true</tokenAuth>
201201
<autoPublish>true</autoPublish>
202202
<waitUntil>published</waitUntil>
203+
<deploymentName>APIMatic Core Library</deploymentName>
203204
</configuration>
204205
</plugin>
205206
<plugin>

0 commit comments

Comments
 (0)