Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

feat: snapshot releases #54

Merged
merged 1 commit into from
Mar 28, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/snapshot-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test & Release Snapshot to Maven Central

env:
MAVEN_ARGS: -V -ntp -e

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java and Maven
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: 'maven'
- name: Run unit tests
run: ./mvnw ${MAVEN_ARGS} -B test --file pom.xml
release-snapshot:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Set up Java and Maven
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: 'maven'
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_profiles: "release"
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USERNAME }}
nexus_password: ${{ secrets.OSSRH_TOKEN }}
18 changes: 18 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<repositories>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<modules>
<module>core</module>
<module>samples</module>
Expand Down