-
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (39 loc) · 1.09 KB
/
maven_package.yml
File metadata and controls
46 lines (39 loc) · 1.09 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
name: Maven Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
# Checkout the repository code
- uses: actions/checkout@v4
# Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# Create settings.xml for publishing to Nexus
- name: Create settings.xml for publishing
run: |
cat <<EOF > $GITHUB_WORKSPACE/settings.xml
<settings>
<servers>
<server>
<id>colddev-repo</id>
<username>${{ secrets.NEXUS_USERNAME }}</username>
<password>${{ secrets.NEXUS_PASSWORD }}</password>
</server>
</servers>
</settings>
EOF
# Build and package the project
- name: Build with Maven
run: mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
# Deploy to Nexus
- name: Deploy to Nexus Repository
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -e -X