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

Test mvn deploy step #642

Merged
merged 5 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/maven-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Verify

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"

- name: Verify with Maven
working-directory: ${{ github.workspace }}/java
run: mvn -B verify
29 changes: 8 additions & 21 deletions .github/workflows/maven-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package
name: Maven Deploy

on:
pull_request:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"

- name: Verify with Maven
working-directory: ${{ github.workspace }}/java
run: mvn -B verify

deploy:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
env:
SONATYPE_USER: ${{secrets.SONATYPE_USER}}
Expand All @@ -42,6 +23,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -60,7 +43,11 @@ jobs:

- name: Publish to Apache Maven Central
working-directory: ${{ github.workspace }}/java
run: mvn release:prepare
run: |
mvn release:prepare --batch-mode \
-DreleaseVersion=${{ github.ref_name }} \
-DdevelopmentVersion=${{ github.ref_name }}-SNAPSHOT \
-Dtag=${{ github.ref_name }} -X
env:
MAVEN_USERNAME: ${{ env.SONATYPE_USER }}
MAVEN_CENTRAL_TOKEN: ${{ env.SONATYPE_PASSWORD }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Release Python Package

on:
release:
types: [created]
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build-linux:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
Expand Down