From 060c5ae8138728c5385facafd24cc4ce3447e565 Mon Sep 17 00:00:00 2001 From: "DESKTOP-10GD4VQ\\Sufyan" Date: Sun, 29 Jun 2025 04:26:57 +0500 Subject: [PATCH] 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. --- .github/workflows/snapshot-release.yml | 36 ++++++++++++++++++++++++++ pom.xml | 1 + 2 files changed, 37 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 00000000..576645eb --- /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: Production + 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 4e71c204..215ff67e 100644 --- a/pom.xml +++ b/pom.xml @@ -200,6 +200,7 @@ true true published + APIMatic Core Library