Improve Github Action for deploy; only deploy non-PR SNAPSHOT versions
@@ -45,21 +45,14 @@ jobs:
# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Build
run: ./mvnw -V -B -ff -ntp verify
- - name: Extract Maven Version
+ - name: Extract project Maven version
id: projectVersion
run: echo ::set-output name=version::$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -DforceStdout -Dexpression=project.version -q)
- - name: Is Snapshot
- if: ${{ endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT') }}
- run: echo 'Is Snapshot'
- - name: Not Snapshot
- if: ${{ !endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT') }}
- run: echo 'Is NOT Snapshot'
- name: Deploy snapshot
- if: github.event_name != 'pull_request' && matrix.java_version == '8'
+ if: github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT')
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
- PROJECT_VERSION: ${{ steps.projectVersion.output.version }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: ./mvnw -B -ff -DskipTests -ntp source:jar deploy
- name: Generate code coverage
