File tree 1 file changed +23
-24
lines changed
1 file changed +23
-24
lines changed Original file line number Diff line number Diff line change 1
1
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2
2
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
3
3
4
- name : Maven Package
4
+ name : Maven Package to Unnamed Repo and github packages
5
5
6
6
on :
7
- release :
8
- types : released
9
-
7
+ release :
8
+ types : [created]
10
9
jobs :
11
- build :
12
-
13
- runs-on : ubuntu-latest
14
-
15
- steps :
16
- - uses : actions/checkout@v2
17
- - name : Set up JDK 1.8
18
- uses : actions/setup-java@v1
19
- with :
20
- java-version : 1.8
21
- server-id : github # Value of the distributionManagement/repository/id field of the pom.xml
22
- settings-path : ${{ github.workspace }} # location for the settings.xml file
23
-
24
- - name : Build with Maven
25
- run : mvn -B package --file pom.xml
26
-
27
- - name : Publish to GitHub Packages Apache Maven
28
- run : mvn deploy -s $GITHUB_WORKSPACE/settings.xml
29
- env :
30
- GITHUB_TOKEN : ${{ github.token }}
10
+ publish :
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : read
14
+ packages : write
15
+ steps :
16
+ - uses : actions/checkout@v4
17
+ - name : Set up Java for publishing to unnamed repo
18
+ uses : actions/setup-java@v3
19
+ with :
20
+ java-version : ' 17 '
21
+ distribution : ' temurin '
22
+ server-id : unnamed-releases
23
+ server-username : MAVEN_USERNAME
24
+ server-password : MAVEN_PASSWORD
25
+ - name : Publish to unnamed repo
26
+ run : mvn --batch-mode deploy
27
+ env :
28
+ MAVEN_USERNAME : ${{ secrets.USERNAME }}
29
+ MAVEN_PASSWORD : ${{ secrets.TOKEN }}
You can’t perform that action at this time.
0 commit comments