Skip to content

Commit dfe5592

Browse files
committed
Adding settings.xml to use for GitHub actions. For some reason, writing with the GITHUB_TOKEN has no permission to access it's own project repository.
1 parent a477a9d commit dfe5592

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/maven-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
run: mvn -B package --file pom.xml
3030

3131
- name: Publish to GitHub Packages Apache Maven
32-
run: mvn deploy
32+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
3333
env:
3434
GITHUB_TOKEN: ${{ github.token }}

settings.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
4+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
5+
6+
<activeProfiles>
7+
<activeProfile>github</activeProfile>
8+
</activeProfiles>
9+
10+
<profiles>
11+
<profile>
12+
<id>github</id>
13+
<repositories>
14+
<repository>
15+
<id>central</id>
16+
<url>https://repo1.maven.org/maven2</url>
17+
</repository>
18+
<repository>
19+
<id>github</id>
20+
<url>https://maven.pkg.github.com/Koppeltaal/*</url>
21+
<snapshots>
22+
<enabled>true</enabled>
23+
</snapshots>
24+
</repository>
25+
</repositories>
26+
</profile>
27+
</profiles>
28+
29+
<servers>
30+
<server>
31+
<id>github</id>
32+
<username>${env.SETTINGS_XML_USERNAME}</username>
33+
<password>${env.SETTINGS_XML_PASSWORD}</password>
34+
</server>
35+
</servers>
36+
</settings>

0 commit comments

Comments
 (0)