You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jz...@apache.org on 2023/04/11 15:34:13 UTC

[opennlp] branch main updated: OPENNLP-1484 - GitHub Actions: Don't run deploy snapshots, if we have a release version (#525)

This is an automated email from the ASF dual-hosted git repository.

jzemerick pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp.git


The following commit(s) were added to refs/heads/main by this push:
     new 0880435f OPENNLP-1484 - GitHub Actions: Don't run deploy snapshots, if we have a release version (#525)
0880435f is described below

commit 0880435facc86783e34d285aabdb9cea2cc2fa0f
Author: Richard Zowalla <13...@users.noreply.github.com>
AuthorDate: Tue Apr 11 17:34:07 2023 +0200

    OPENNLP-1484 - GitHub Actions: Don't run deploy snapshots, if we have a release version (#525)
---
 .github/workflows/publish-snapshots.yml | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml
index 41ca0125..a5dd55f2 100644
--- a/.github/workflows/publish-snapshots.yml
+++ b/.github/workflows/publish-snapshots.yml
@@ -30,20 +30,29 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
       - name: Cache Maven Repository
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           path: ~/.m2/repository
           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
             ${{ runner.os }}-maven-
       - name: Setup Java
-        uses: actions/setup-java@v2
+        uses: actions/setup-java@v3
         with:
           distribution: adopt
           java-version: 11
+      - id: extract_version
+        name: Extract version
+        shell: bash
+        run: |
+          VERSION=$(mvn exec:exec -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive -q)
+          if [[ "$VERSION" == *"SNAPSHOT"* ]]; then
+             echo "snapshot=SNAPSHOT" >> $GITHUB_OUTPUT
+          fi
       - name: Deploy Maven snapshots
+        if: steps.extract_version.outputs.snapshot == 'SNAPSHOT'
         env:
           ASF_USERNAME: ${{ secrets.NEXUS_USER }}
           ASF_PASSWORD: ${{ secrets.NEXUS_PW }}