-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.52 KB
/
nexus-publish-snapshots.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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: Deploy Snapshot
on:
push:
branches:
- development
jobs:
publish_snapshot:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
settings-path: ${{ github.workspace }}
- name: Load local Maven repository cache
uses: actions/cache@v3
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 --settings $GITHUB_WORKSPACE/.github.settings.xml deploy
env:
MAVEN_REPO_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_REPO_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}