Skip to content

Commit 548e083

Browse files
committed
Add GitHub Actions workflow for Maven publish
Introduces a GitHub Actions workflow to publish Maven artifacts to GitHub Packages on push to main. Updates both spring-web-captor and spring-web-captor-xml pom.xml files to include distributionManagement sections for publishing to GitHub Packages.
1 parent 6f8d123 commit 548e083

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Maven Publish to GitHub Packages
2+
3+
#on:
4+
# release:
5+
# types: [ created ]
6+
7+
on:
8+
push:
9+
branches: [ "main" ]
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: 'temurin'
26+
java-version: '21'
27+
server-id: github
28+
settings-path: ${{ github.workspace }}
29+
30+
- name: Build and deploy to GitHub Packages
31+
run: mvn -B deploy -DskipTests=true -s $GITHUB_WORKSPACE/settings.xml
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

spring-web-captor-xml/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,11 @@
6363
<scope>test</scope>
6464
</dependency>
6565
</dependencies>
66-
66+
<distributionManagement>
67+
<repository>
68+
<id>github</id>
69+
<name>GitHub Packages</name>
70+
<url>https://maven.pkg.github.com/david-randoll/spring-web-captor-xml</url>
71+
</repository>
72+
</distributionManagement>
6773
</project>

spring-web-captor/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,11 @@
4949
<scope>test</scope>
5050
</dependency>
5151
</dependencies>
52+
<distributionManagement>
53+
<repository>
54+
<id>github</id>
55+
<name>GitHub Packages</name>
56+
<url>https://maven.pkg.github.com/david-randoll/spring-web-captor</url>
57+
</repository>
58+
</distributionManagement>
5259
</project>

0 commit comments

Comments
 (0)