Skip to content

Commit a262fd9

Browse files
committed
Deploy jar artifact into GitHub registry
1 parent 1a69ea5 commit a262fd9

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
File renamed without changes.

.github/workflows/maven_deploy.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
20+
settings-path: ${{ github.workspace }} # location for the settings.xml file
21+
22+
- name: Build with Maven
23+
run: mvn -B package --file pom.xml
24+
25+
- name: Publish to GitHub Packages Apache Maven
26+
run: |
27+
GITHUB_TAG=${GITHUB_REF#refs/tags/}
28+
GITHUB_VERSION=${GITHUB_TAG#"v"}
29+
30+
mvn -B versions:set -DnewVersion=${GITHUB_VERSION}
31+
mvn deploy -s $GITHUB_WORKSPACE/settings.xml
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}

pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,12 @@
5656
</plugin>
5757
</plugins>
5858
</build>
59+
60+
<distributionManagement>
61+
<repository>
62+
<id>github</id>
63+
<name>GitHub borisskert Apache Maven Packages</name>
64+
<url>https://maven.pkg.github.com/borisskert/java-sudoku</url>
65+
</repository>
66+
</distributionManagement>
5967
</project>

0 commit comments

Comments
 (0)