Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.

Commit 21fbe19

Browse files
authored
Create maven-publish.yml
1 parent 1986f82 commit 21fbe19

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Maven Package
5+
6+
on:
7+
workflow_dispatch:
8+
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up JDK 16
24+
uses: actions/setup-java@v2
25+
with:
26+
java-version: '16'
27+
distribution: 'adopt'
28+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
29+
settings-path: ${{ github.workspace }} # location for the settings.xml file
30+
31+
- name: Build with Maven
32+
run: mvn -B package --file pom.xml
33+
34+
- name: Publish to GitHub Packages Apache Maven
35+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
36+
env:
37+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)