Skip to content

Commit 6ca8135

Browse files
authored
chore(action): add publish maven action
1 parent 0a54563 commit 6ca8135

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Maven Package
5+
6+
on:
7+
workflow_dispatch:
8+
release:
9+
types: [created]
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up JDK 11
22+
uses: actions/setup-java@v3
23+
with:
24+
java-version: '11'
25+
distribution: 'temurin'
26+
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml
27+
settings-path: ${{ github.workspace }} # location for the settings.xml file
28+
29+
- name: Build with Maven
30+
run: mvn -B package --file pom.xml
31+
32+
- name: Publish to GitHub Packages Apache Maven
33+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
34+
env:
35+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)