Configure experimental annotations, binary compatibility validator, dokka, build, publishing, for mirai-console.

This commit is contained in:
Him188 2021-01-28 09:48:14 +08:00
parent 5f9625c35e
commit 550899afa0
5 changed files with 131 additions and 56 deletions

27
.github/workflows/all-build.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: All Build
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: chmod +x gradlew
run: chmod +x gradlew
- name: git submodule init
run: git submodule init
- name: git submodule update --remote
run: git submodule update --remote
- name: Init gradle project
run: ./gradlew clean
- name: Build all
run: ./gradlew assemble
- name: All Tests
run: ./gradlew check

View File

@ -18,60 +18,95 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check keys
run: >
./gradlew :mirai-core-utils:ensureBintrayAvailable
:mirai-core-api:ensureBintrayAvailable
:mirai-core:ensureBintrayAvailable
:mirai-console:ensureBintrayAvailable
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle clean
run: ./gradlew clean
- name: Gradle build
run: ./gradlew build # if test's failed, don't publish
- name: Check keys
- name: Init gradle project
run: ./gradlew clean --info
- name: fillBuildConstants
run: >
./gradlew :mirai-core-utils:ensureBintrayAvailable
:mirai-core-api:ensureBintrayAvailable
:mirai-core:ensureBintrayAvailable
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
./gradlew
fillBuildConstants --info --stacktrace
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Assemble
run: ./gradlew assemble --info --stacktrace
- name: Check
run: ./gradlew check --info --stacktrace
- name: Gradle :mirai-core-utils:publish
run: >
./gradlew :mirai-core-utils:publish --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
./gradlew :mirai-core-utils:publish --info --stacktrace
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-core-api:publish
run: >
./gradlew :mirai-core-api:publish --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
./gradlew :mirai-core-api:publish --info --stacktrace
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-core:publish
run: >
./gradlew :mirai-core:publish --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
./gradlew :mirai-core:publish --info --stacktrace
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-core-all:bintrayUpload
run: >
./gradlew :mirai-core-all:bintrayUpload --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
./gradlew :mirai-core-all:bintrayUpload --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
# - name: Upload artifact
# uses: actions/upload-artifact@v1.0.0
# with:
# # Artifact name
# name: mirai-core
# # Directory containing files to upload
# path: "mirai-core/build/libs/mirai-core-*-all.jar"
# - name: Upload artifact
# uses: actions/upload-artifact@v1.0.0
# with:
# # Artifact name
# name: mirai-core-qqandroid-all
# # Directory containing files to upload
# path: "mirai-core-qqandroid/build/libs/mirai-core-qqandroid-*-all.jar"
- name: Gradle :mirai-console:bintrayUpload
run: >
./gradlew
:mirai-console:bintrayUpload --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-console-terminal:bintrayUpload
run: >
./gradlew
:mirai-console-terminal:bintrayUpload --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-console-compiler-common:bintrayUpload
run: >
./gradlew
:mirai-console-compiler-common:bintrayUpload --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-console-intellij:bintrayUpload
run: >
./gradlew
:mirai-console-intellij:bintrayUpload --info
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Publish Gradle plugin
run: >
./gradlew
:mirai-console-gradle:publishPlugins --info --stacktrace
-Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
-Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}

View File

@ -1,19 +0,0 @@
name: Gradle CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build

23
.github/workflows/mirai-core-build.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: mirai-core Build
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: chmod +x gradlew
run: chmod +x gradlew
- name: Init gradle project
run: ./gradlew clean
- name: Build mirai-core series
run: ./gradlew assemble
- name: mirai-core Tests
run: ./gradlew check

View File

@ -56,7 +56,10 @@ configure<kotlinx.validation.ApiValidationExtension> {
ignoredPackages.add("net.mamoe.mirai.internal")
ignoredPackages.add("net.mamoe.mirai.console.internal")
nonPublicMarkers.add("net.mamoe.mirai.MiraiInternalApi")
nonPublicMarkers.add("net.mamoe.mirai.console.utils.ConsoleInternalApi")
nonPublicMarkers.add("net.mamoe.mirai.console.utils.ConsoleExperimentalApi")
nonPublicMarkers.add("net.mamoe.mirai.MiraiExperimentalApi")
}
@ -116,9 +119,11 @@ allprojects {
}
}
}
subprojects {
afterEvaluate {
if (project.name == "mirai-core-api") configureDokka()
if (project.name == "mirai-console") configureDokka()
}
}
@ -148,7 +153,9 @@ fun Project.configureDokka() {
for (suppressedPackage in arrayOf(
"""net.mamoe.mirai.internal""",
"""net.mamoe.mirai.internal.message""",
"""net.mamoe.mirai.internal.network"""
"""net.mamoe.mirai.internal.network""",
"""net.mamoe.mirai.console.internal""",
"""net.mamoe.mirai.console.compiler.common"""
)) {
perPackageOption {
matchingRegex.set(suppressedPackage.replace(".", "\\."))
@ -274,6 +281,8 @@ val experimentalAnnotations = arrayOf(
"kotlin.experimental.ExperimentalTypeInference",
"kotlin.ExperimentalUnsignedTypes",
"kotlin.time.ExperimentalTime",
"kotlin.io.path.ExperimentalPathApi",
"io.ktor.util.KtorExperimentalAPI",
"kotlinx.serialization.ExperimentalSerializationApi",