File tree 3 files changed +18
-17
lines changed
3 files changed +18
-17
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/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3
+ # also ref:
4
+ # Publishing packages to GitHub Packages:
5
+ # https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven#publishing-packages-to-github-packages
6
+ #
7
+ # Upgrade to Automatic token authentication, no need for personal access token anymore
8
+ # ref: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-a-registry-using-a-personal-access-token
9
+ #
3
10
4
- name : Maven Package and Publish to GitHub Packages
11
+ name : Publish to GitHub Packages
5
12
6
13
run-name : ' Package Publish #${{github.run_number}}'
7
14
8
15
on :
9
16
release :
10
17
types : [published]
11
-
12
18
workflow_dispatch :
13
19
14
20
jobs :
15
21
build :
16
22
runs-on : ubuntu-latest
17
23
18
24
permissions :
19
- contents : read
20
25
packages : write
26
+ contents : read
21
27
22
28
steps :
23
- - name : Checkout code
29
+ - name : Checkout Code
24
30
uses : actions/checkout@v4
25
31
26
32
- name : Set up JDK
@@ -29,14 +35,10 @@ jobs:
29
35
java-version : ' 21'
30
36
distribution : ' oracle'
31
37
server-id : ' github-package'
32
- cache : ' maven'
33
-
34
- - name : Build with Maven
35
- run : mvn --batch-mode package --file pom.xml
36
38
37
39
- name : Publish to GitHub Packages Apache Maven
38
40
run : mvn --batch-mode deploy
39
41
env :
40
42
GITHUB_MAVEN_URL : https://maven.pkg.github.com/${{github.repository}}
41
- GITHUB_TOKEN : ${{secrets.PACKAGE_PUBLISH_TOKEN }}
43
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN }}
42
44
Original file line number Diff line number Diff line change 3
3
target /
4
4
dependency-reduced-pom.xml
5
5
6
+ # File for local testing
7
+ src /test /java /TestField.java
8
+
9
+ # File generated by Idea
10
+ .idea
11
+
6
12
# Log file
7
13
* .log
8
14
Original file line number Diff line number Diff line change 46
46
</dependency >
47
47
</dependencies >
48
48
49
- <pluginRepositories >
50
- <pluginRepository >
51
- <id >maven-snapshots</id >
52
- <url >https://repository.apache.org/content/repositories/snapshots/</url >
53
- </pluginRepository >
54
- </pluginRepositories >
55
-
56
49
<build >
57
50
<plugins >
58
51
<plugin >
127
120
<distributionManagement >
128
121
<repository >
129
122
<id >github-package</id >
130
- <name >Github Package</name >
131
123
<url >${env.GITHUB_MAVEN_URL} </url >
124
+ <!-- refer to .github/workflows/maven-publish-ghpkg.yml -->
132
125
</repository >
133
126
</distributionManagement >
134
127
</project >
You can’t perform that action at this time.
0 commit comments