Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create release-maven-publish.yml #836

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/master-maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
push:
branches:
- main
- 'releases/**'
tags:
- 'v**'
release:
types: [created]
jobs:
build:
name: Maven build and deploy
Expand All @@ -30,7 +25,7 @@ jobs:
mvn -B package --file pom.xml

- name: Publish to GitHub Packages
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
if: github.event_name == 'push'
run: mvn -B deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/release-maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Maven build and package for Release

on:
release:
types: [published]
jobs:
build:
name: Maven build and deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 8*
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8

- name: Build with Maven
run: |
mvn dependency:resolve -B -U
mvn clean install -DskipTests -Dmaven.javadoc.skip=true -B
mvn -B package --file pom.xml

- name: Publish to GitHub Packages
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
run: mvn -B deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}