Skip to content

🔀 Merge pull request #18 from vinceglb/dependabot/gradle/com.vannikte… #25

🔀 Merge pull request #18 from vinceglb/dependabot/gradle/com.vannikte…

🔀 Merge pull request #18 from vinceglb/dependabot/gradle/com.vannikte… #25

name: Publish Snapshot
on:
push:
branches:
- main
workflow_dispatch:
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
is_snapshot: ${{ steps.check_snapshot.outputs.is_snapshot }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Check for SNAPSHOT suffix
id: check_snapshot
run: |
VERSION_NAME=$(grep "^VERSION_NAME=" gradle.properties | cut -d '=' -f 2)
if [[ $VERSION_NAME == *-SNAPSHOT ]]; then
echo "::set-output name=is_snapshot::true"
else
echo "::set-output name=is_snapshot::false"
fi
publish:
name: Publish to Snapshot
runs-on: ubuntu-latest
needs: check-version
if: ${{ needs.check-version.outputs.is_snapshot == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}