File tree 1 file changed +4
-45
lines changed
1 file changed +4
-45
lines changed Original file line number Diff line number Diff line change @@ -6,70 +6,29 @@ name: Maven Package
6
6
on :
7
7
release :
8
8
types : [created]
9
-
10
- workflow_dispatch :
11
9
12
10
jobs :
13
11
build :
12
+
14
13
runs-on : ubuntu-latest
15
14
permissions :
16
15
contents : read
17
16
packages : write
18
17
19
18
steps :
20
19
- uses : actions/checkout@v4
21
-
22
20
- name : Set up JDK 8
23
21
uses : actions/setup-java@v3
24
22
with :
25
23
java-version : ' 8'
26
24
distribution : ' temurin'
27
- server-id : github
28
- settings-path : ${{ github.workspace }}
29
-
30
- - name : Create settings.xml
31
- run : |
32
- echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
33
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34
- xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
35
- http://maven.apache.org/xsd/settings-1.0.0.xsd">
36
-
37
- <activeProfiles>
38
- <activeProfile>github</activeProfile>
39
- </activeProfiles>
40
-
41
- <profiles>
42
- <profile>
43
- <id>github</id>
44
- <repositories>
45
- <repository>
46
- <id>central</id>
47
- <url>https://repo1.maven.org/maven2</url>
48
- </repository>
49
- <repository>
50
- <id>github</id>
51
- <url>https://maven.pkg.github.com/multiform-validator/java</url>
52
- <snapshots>
53
- <enabled>true</enabled>
54
- </snapshots>
55
- </repository>
56
- </repositories>
57
- </profile>
58
- </profiles>
59
-
60
- <servers>
61
- <server>
62
- <id>github</id>
63
- <username>gabriel-logan</username>
64
- <password>${{secrets.MULTIFORM_VALIDATOR_MVN_TOKEN_GITHUB_PACKAGES}}</password>
65
- </server>
66
- </servers>
67
- </settings>' > settings.xml
25
+ server-id : github # Value of the distributionManagement/repository/id field of the pom.xml
26
+ settings-path : ${{ github.workspace }} # location for the settings.xml file
68
27
69
28
- name : Build with Maven
70
29
run : mvn -B package --file pom.xml
71
30
72
31
- name : Publish to GitHub Packages Apache Maven
73
- run : mvn deploy -s settings.xml
32
+ run : mvn deploy -s $GITHUB_WORKSPACE/ settings.xml
74
33
env :
75
34
GITHUB_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments