[ci] publish snapshots with every commit to main (#16)

Adds a workflow for publishing a snapshot to sonatype with each commit
to main.
This commit is contained in:
Julien Perrochet 2024-01-31 10:51:09 +01:00 committed by GitHub
parent a51f455e33
commit 4cef820c9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
name: Snapshot Releases
# Only run on pushes to main:
# Replace with 'on: [push]' if you need to run tests on your PR
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
# Modules specify the oldest java version that they support:
# even if we build with version 21, produced jars should be compatible with
# JVMs running the version specified in each module's maven.compiler.target property
java-version: '21'
distribution: 'temurin'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: Publish package
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
# Notes:
# - tests already run in a separate action
run: mvn --batch-mode deploy -DskipTests