Skip to content

Commit 45270ac

Browse files
authored
Update maven-publish.yml
1 parent 1f30189 commit 45270ac

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
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
1+
name: Build Plugin
52

63
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
78
release:
89
types: [created]
910

1011
jobs:
1112
build:
12-
1313
runs-on: ubuntu-latest
14-
permissions:
15-
contents: read
16-
packages: write
17-
14+
1815
steps:
1916
- uses: actions/checkout@v3
20-
- name: Set up JDK 18
17+
18+
- name: Set up JDK 17
2119
uses: actions/setup-java@v3
2220
with:
23-
java-version: '18'
21+
java-version: '17'
2422
distribution: 'temurin'
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
27-
23+
cache: maven
24+
2825
- name: Build with Maven
2926
run: mvn -B package --file pom.xml
30-
31-
- name: Publish to GitHub Packages Apache Maven
32-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
33-
env:
34-
GITHUB_TOKEN: ${{ github.token }}
27+
28+
- name: Upload to release
29+
if: github.event_name == 'release'
30+
uses: softprops/action-gh-release@v1
31+
with:
32+
files: target/*.jar

0 commit comments

Comments
 (0)