Skip to content

Commit 37f03aa

Browse files
authored
feat(snapshot-release): add snapshot repository configuration (#74)
1 parent 5ed7b39 commit 37f03aa

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: 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 }}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,5 @@
192192
<url>https://github.com/apimatic/core-interfaces-java/blob/main/LICENSE</url>
193193
</license>
194194
</licenses>
195+
195196
</project>

0 commit comments

Comments
 (0)