File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}
You can’t perform that action at this time.
0 commit comments