Skip to content

Commit

Permalink
extract version from pom
Browse files Browse the repository at this point in the history
  • Loading branch information
jburel authored and sbesson committed Feb 22, 2021
1 parent f51a7f7 commit 004c318
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,20 @@ jobs:
- name: Build
run: mvn ${{ env.maven_commands }}
deploy:
if: contains('refs/heads/develop', github.ref) || startsWith(github.ref, 'refs/tags')
if: contains('refs/heads/develop', github.ref)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get server
id: get_server
- name: Retrieve version
id: get_version
run: |
if [${{ github.ref }} == 'refs/heads/develop']; then
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )
echo "::set-output name=version::$VERSION"
- name: Set server
id: set_server
run: |
if [[ ${{ steps.get_version.outputs.version }} =~ 'SNAPSHOT' ]]; then
echo ::set-output name=server::'ome.snapshots'
else
echo ::set-output name=server::'ome.staging'
Expand All @@ -50,7 +55,7 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ${{ steps.get_server.outputs.server }}
server-id: ${{ steps.set_server.outputs.server }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy SNAPSHOT
Expand Down

0 comments on commit 004c318

Please sign in to comment.