Skip to content

Commit

Permalink
Switch to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhofmann committed Oct 11, 2023
1 parent c9f586e commit 84d8b75
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 46 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/maven-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: Pull Request Checks

on:
release:
on: [ pull_request ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrhs01 # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
run: mvn -B package --file pom.xml
33 changes: 33 additions & 0 deletions .github/workflows/maven-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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 "Snapshot" Release

on:
release:
types: [created]

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

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrhs01 # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Change Versions
run: mvn versions:set -DnewVersion=${{ github.ref_name }}-SNAPSHOT
- name: Publish to OSSRH with Apache Maven
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/maven-publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 Snapshot deploy

on:
push:
branches:
- 'main'
- '2022.06.x'
- '2021.06.x'
jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrhs01 # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish to OSSRH with Apache Maven
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
46 changes: 0 additions & 46 deletions Jenkinsfile

This file was deleted.

0 comments on commit 84d8b75

Please sign in to comment.