diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..5a86aeb --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,52 @@ + +# Publish a Snapshot Release +name: Snapshot + +on: + push: + branches: + - 'develop' + +jobs: + build: + + name: Publish snapshot + runs-on: ubuntu-latest + + steps: + + # ================================ + # SHALLOW CLONE + # ================================ + - name: Shallow clone + uses: actions/checkout@v3 + + # ================================ + # SET UP JDK + # ================================ + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-package: jdk + java-version: 21 + + # ================================ + # EXPORT GRADLE PROJECT PROPERTIES + # ================================ + - name: Export Gradle project properties + id: properties + run: './gradlew properties -q | grep ": " | sed "s/: /=/" >> "$GITHUB_OUTPUT"' + + # ================================ + # PUBLISH + # ================================ + - name: Publish snapshot + if: endsWith(steps.properties.outputs.version, '-SNAPSHOT') + env: + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} + uses: gradle/gradle-build-action@v2 + with: + arguments: publish -Psnapshot --info --scan