Skip to content

Merge pull request #381 from qbicsoftware/chore-add-cfmp-facility #49

Merge pull request #381 from qbicsoftware/chore-add-cfmp-facility

Merge pull request #381 from qbicsoftware/chore-add-cfmp-facility #49

# This workflow will build a package using Maven and then publish it to
# qbic-repo.qbic.uni-tuebingen.de packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Nexus Publish Snapshots
on:
push:
branches:
- development
jobs:
publish_snapshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }}
- name: Load local Maven repository cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Remove existing snapshot tags which are not supposed to be present
- name: Remove snapshot tags
run: mvn versions:set -DremoveSnapshot
# Set the SNAPSHOT for this build and deployment
- name: Set version in Maven project
run: mvn versions:set -DnewVersion='${project.version}-SNAPSHOT'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish artefact to QBiC Nexus Repository
run: mvn --quiet --activate-profiles development-build,!release-build --settings $GITHUB_WORKSPACE/.github.settings.xml deploy
env:
MAVEN_REPO_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_REPO_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}