Skip to content

Commit b84b483

Browse files
authored
Create maven-publish.yml
1 parent 2d8ad8a commit b84b483

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/maven-publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Maven Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
23+
settings-path: ${{ github.workspace }} # location for the settings.xml file
24+
25+
- name: Build with Maven
26+
run: mvn -B package --file pom.xml
27+
28+
- name: Publish to GitHub Packages Apache Maven
29+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
30+
env:
31+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)