-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 2.54 KB
/
maven-publish-release.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Maven Deploy & Release
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # Access to Publish a Release
packages: write # Access to Publish a Package
#--------------------------------------------------------------------------------------------
# Build the Artifact and Publish to Luxious Repository
#--------------------------------------------------------------------------------------------
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Maven Settings
uses: s4u/[email protected]
with:
servers: '[{"id": "luxious-public", "username": "${{ secrets.MAVEN_NAME }}", "password": "${{ secrets.MAVEN_SECRET }}"}, {"id": "luxious-private", "username": "${{ secrets.MAVEN_NAME }}", "password": "${{ secrets.MAVEN_SECRET }}"}]'
- name: Build & Publish to Luxious Maven
run: mvn -B deploy --file pom.xml
#--------------------------------------------------------------------------------------------
# Create a Github Release
#--------------------------------------------------------------------------------------------
- name: Extract Maven Project Version
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
id: project
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "target/factionintegrations-${{ steps.project.outputs.version }}.jar"
allowUpdates: true
removeArtifacts: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
tag: "${{ steps.project.outputs.version }}"
# Update the README.md Badge with the new version
- name: Create Version Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 176f75278bd544e8657fdcf5562e7693
filename: test.json # Use test.svg if you want to use the SVG mode.
label: Latest Release
message: "${{ steps.project.outputs.version }}"
color: blue