-
Notifications
You must be signed in to change notification settings - Fork 7
65 lines (55 loc) · 1.87 KB
/
Copy pathnexus-release.yml
File metadata and controls
65 lines (55 loc) · 1.87 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Publish package to Netgrif Nexus
on: workflow_dispatch
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: cardinalby/git-get-release-action@v1
id: getEnvRelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Project Version from pom.xml
uses: entimaniac/read-pom-version-action@1.0.0
id: getVersion
# - name: Check Enviroment release
# if: ${{ !((steps.getEnvRelease.outputs.prerelease && contains(steps.getVersion.outputs.version, '-SNAPSHOT')) || (!steps.getEnvRelease.outputs.prerelease && !contains(steps.getVersion.outputs.version, '-SNAPSHOT'))) }}
# run: exit 1
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build
run: mvn clean verify -DskipTests=true
publish-OSSRH:
runs-on: ubuntu-latest
name: Publish to Netgrif Nexus
needs: build
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
server-id: netgrif-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn -DskipTests=true --batch-mode -P netgrif-nexus-publish deploy
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}