diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..dc7be8cd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Testing Nexus +on: + push: + branches: + - 'testingNexus' + pull_request: + branches: + - 'testingNexus' + workflow_dispatch: +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Wrapper Integrity + uses: gradle/actions/wrapper-validation@v3 + - name: Setup Java + uses: actions/setup-java@v4 + with: { java-version: 17, distribution: temurin } + - name: Run Tests + uses: gradle/actions/setup-gradle@v3 + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + ORG_GRADLE_PROJECT_sonatypeNexusUrl: ${{ secrets.SONATYPE_NEXUS_URL }} + with: + arguments: | + check \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2ca1fa12..454ea7ce 100644 --- a/build.gradle +++ b/build.gradle @@ -120,4 +120,15 @@ apply from: rootProject.file("gradle/docs.gradle") //do not generate extra load on Nexus with new staging repository if signing fails tasks.withType(InitializeNexusStagingRepository).configureEach { shouldRunAfter(tasks.withType(Sign)) +} + +def toCheck = rootProject.findProperty('sonatypeNexusUrl') +if(!toCheck) { + System.out.println("No sonatype nexus url found") +} +else if(toCheck != 'https://s01.oss.sonatype.org/service/local/') { + throw new IllegalStateException("Invalid Sonatype Url Value") +} +else { + System.out.println("Found correct sonatype url value") } \ No newline at end of file