From 0206d2aec4447f809fc22f9b41ce1aa4cab56906 Mon Sep 17 00:00:00 2001 From: Hamza Mahmood Date: Mon, 11 Aug 2025 19:02:03 +0500 Subject: [PATCH 1/2] feat(snapshot-release): add snapshot repository configuration --- .github/workflows/snapshot-release.yml | 36 ++++++++++++++++++++++++++ pom.xml | 14 ++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/snapshot-release.yml diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml new file mode 100644 index 0000000..754eb67 --- /dev/null +++ b/.github/workflows/snapshot-release.yml @@ -0,0 +1,36 @@ +name: Snapshot Release To Maven Central +run-name: Publishing Snapshot Package Version ${{ github.event.inputs.Version }}-SNAPSHOT + +on: + workflow_dispatch: + inputs: + Version: + 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." + required: true + +jobs: + publish: + name: Publish the Maven package + runs-on: ubuntu-latest + environment: Sandbox + steps: + - name: Check out git repository + uses: actions/checkout@v2 + with: + ref: ${{ github.ref_name }} + + - name: Install Java and Maven setup + uses: actions/setup-java@v1 + with: + java-version: 8 + + - name: Update version in POM + run: mvn -B versions:set -DnewVersion=${{ github.event.inputs.Version }}-SNAPSHOT -DgenerateBackupPoms=false + - name: Release to Maven Central + id: release + uses: samuelmeuli/action-maven-publish@v1 + with: + gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg_passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }} + nexus_username: ${{ secrets.OSSRH_USERNAME }} + nexus_password: ${{ secrets.OSSRH_PASSWORD }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index f59a97d..ca009fc 100644 --- a/pom.xml +++ b/pom.xml @@ -192,4 +192,18 @@ https://github.com/apimatic/core-interfaces-java/blob/main/LICENSE + + + + central-portal-snapshots + Central Portal Snapshots + https://central.sonatype.com/repository/maven-snapshots/ + + false + + + true + + + From cffbd6aafef897cbefd52e064731f285e9cc6546 Mon Sep 17 00:00:00 2001 From: Hamza Mahmood Date: Tue, 12 Aug 2025 11:45:09 +0500 Subject: [PATCH 2/2] Update pom.xml --- pom.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pom.xml b/pom.xml index ca009fc..7ddbf9e 100644 --- a/pom.xml +++ b/pom.xml @@ -193,17 +193,4 @@ - - - central-portal-snapshots - Central Portal Snapshots - https://central.sonatype.com/repository/maven-snapshots/ - - false - - - true - - -