Skip to content

Commit

Permalink
Refactor snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
markpatton committed Dec 13, 2023
1 parent 7b96560 commit 2013126
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ on:
- 'main'

jobs:
setup:
snapshot:
runs-on: ubuntu-latest
outputs:
# Output project version from the POM to conditionally run dependent steps
project-version: ${{ steps.project_version.outputs.version }}
steps:
- name: Checkout latest code
uses: actions/checkout@v3
Expand All @@ -33,15 +30,9 @@ jobs:
id: project_version
run: echo "VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`" >> $GITHUB_OUTPUT

# Run only if project POM has version ending in "-SNAPSHOT"
snapshot:
needs: setup
if: endsWith(needs.setup.outputs.project-version, '-SNAPSHOT')
runs-on: ubuntu-latest
steps:
- name: Debug
run: echo "$VERSION `pwd` `ls`"
# Only execute for -SNAPSHOT versions
- name: Publish SNAPSHOT
if: ${{ endsWith(steps.project_version.outputs.version, '-SNAPSHOT') }}
run: mvn -B -ntp clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down

0 comments on commit 2013126

Please sign in to comment.