diff --git a/.github/workflows/check-license.yaml b/.github/workflows/check-license.yaml index 7f11d49..9c07884 100644 --- a/.github/workflows/check-license.yaml +++ b/.github/workflows/check-license.yaml @@ -1,34 +1,12 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - name: License Check on: push: - branches: [ master ] + branches: "**" + tags-ignore: ["**"] pull_request: - branches: [ master ] jobs: - build: - # Only run on PRs if the source branch is on someone else's repo - if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}" - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}" - restore-keys: | - ${{ runner.os }}-gradle- - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - distribution: adopt - java-version: 11 - - name: Build with Gradle - run: ./gradlew checkLicenses + call-check: + uses: SpongePowered/.github/.github/workflows/shared-check-license.yaml@master + secrets: inherit diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1babee9..c287280 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,80 +11,6 @@ on: types: [released] jobs: - build: - # Only run on PRs if the source branch is on someone else's repo - if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}" - - runs-on: "${{ matrix.os }}" - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - steps: - # Setup - - name: Check out - uses: actions/checkout@v2 - - name: Setup JDK 11 - uses: actions/setup-java@v2 - with: - distribution: adopt - java-version: 11 - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - # Checks branch name to see if we're going to potentially publish this - - name: Check branch for publish - uses: actions-ecosystem/action-regex-match@v2.0.2 - id: branch-name - with: - text: ${{ github.ref }} - regex: '^refs/heads/(master|(\d+\.\d+\.x))$' # master or something like 0.8.x - - # Actually build - - name: Build with Gradle - run: ./gradlew build - - name: Archive test results - if: "${{ always() }}" - uses: actions/upload-artifact@v2 - with: - name: "test-results-${{ matrix.os }}" - path: | - build/reports - */build/reports - - # Then publish if we are all set up to do so - - name: Determine status - if: "${{ runner.os == 'Linux' }}" - run: | - if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then - echo "STATUS=snapshot" >> $GITHUB_ENV - else - echo "STATUS=release" >> $GITHUB_ENV - fi - - name: Publish with Gradle (snapshot) - if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && steps.branch-name.outputs.match != '' }}" - run: ./gradlew -PforceSign=true publish - env: - ORG_GRADLE_PROJECT_githubPackagesUsername: "${{ github.actor }}" - ORG_GRADLE_PROJECT_githubPackagesPassword: "${{ secrets.GITHUB_TOKEN }}" - ORG_GRADLE_PROJECT_spongeSnapshotRepo: "${{ secrets.SPONGE_MAVEN_SNAPSHOT_REPO_URL }}" - ORG_GRADLE_PROJECT_spongeReleaseRepo: "${{ secrets.SPONGE_MAVEN_RELEASE_REPO_URL }}" - ORG_GRADLE_PROJECT_spongeUsername: "${{ secrets.SPONGE_MAVEN_REPO_USER }}" - ORG_GRADLE_PROJECT_spongePassword: "${{ secrets.SPONGE_MAVEN_REPO_PASSWORD }}" - ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SPONGE_MAVEN_OSSRH_USER }}" - ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SPONGE_MAVEN_OSSRH_PASSWORD }}" - ORG_GRADLE_PROJECT_spongeSigningKey: "${{ secrets.SPONGE_SIGNING_KEY }}" - ORG_GRADLE_PROJECT_spongeSigningPassword: "${{ secrets.SPONGE_SIGNING_PASSWORD }}" - - name: Publish with Gradle (release) - if: "${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'release' }}" - run: ./gradlew publish - env: - ORG_GRADLE_PROJECT_githubPackagesUsername: "${{ github.actor }}" - ORG_GRADLE_PROJECT_githubPackagesPassword: "${{ secrets.GITHUB_TOKEN }}" - ORG_GRADLE_PROJECT_spongeSnapshotRepo: "${{ secrets.SPONGE_MAVEN_SNAPSHOT_REPO_URL }}" - ORG_GRADLE_PROJECT_spongeReleaseRepo: "${{ secrets.SPONGE_MAVEN_RELEASE_REPO_URL }}" - ORG_GRADLE_PROJECT_spongeUsername: "${{ secrets.SPONGE_MAVEN_REPO_USER }}" - ORG_GRADLE_PROJECT_spongePassword: "${{ secrets.SPONGE_MAVEN_REPO_PASSWORD }}" - ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SPONGE_MAVEN_OSSRH_USER }}" - ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SPONGE_MAVEN_OSSRH_PASSWORD }}" - ORG_GRADLE_PROJECT_spongeSigningKey: "${{ secrets.SPONGE_SIGNING_KEY }}" - ORG_GRADLE_PROJECT_spongeSigningPassword: "${{ secrets.SPONGE_SIGNING_PASSWORD }}" + call-build: + uses: SpongePowered/.github/.github/workflows/shared-ci.yaml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 593f4d1..743c09a 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -7,26 +7,6 @@ on: - cron: 12 10 * * 4 jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup JDK 11 - uses: actions/setup-java@v2 - with: - distribution: adopt - java-version: 11 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: java - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + call-analyze: + uses: SpongePowered/.github/.github/workflows/shared-codeql-analysis.yaml@master + secrets: inherit diff --git a/build.gradle.kts b/build.gradle.kts index 6cf7733..cc80493 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("org.spongepowered.gradle.sponge.dev") version "2.0.2" id("net.kyori.indra.publishing.sonatype") version "2.1.1" + id("net.kyori.indra.crossdoc") version "2.1.1" } defaultTasks("build") @@ -52,6 +53,10 @@ spongeConvention { } } +indraCrossdoc { + baseUrl(providers.gradleProperty("javadocPublishRoot")) +} + dependencies { api("org.spongepowered:plugin-meta:0.8.0") api("org.apache.maven:maven-artifact:3.8.6") diff --git a/gradle.properties b/gradle.properties index 3a6a67a..beeea93 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,4 @@ specVersion = 2.0 organization=SpongePowered description=A plugin service protocol projectUrl=https://github.com/SpongePowered/plugin-spi +javadocPublishRoot=https://jd.spongepowered.org/