Merge pull request #426 from HCL-TECH-SOFTWARE/feature/issue-425-init… #383
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push-to-develop | |
# Run workflow on commits to the `develop` branch | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: Install Java and Maven | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "8" | |
distribution: "adopt" | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Extract Project version | |
id: project | |
run: echo ::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
- name: Release Maven package | |
# Only publish on develop when the version does end on -SNAPSHOT | |
if: ${{ endsWith(steps.project.outputs.version, '-SNAPSHOT') }} | |
run: mvn --batch-mode deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} |