Skip to content

Commit

Permalink
Merge pull request #161 from simple-robot/dev/main
Browse files Browse the repository at this point in the history
Release: v4.0.0-beta5
  • Loading branch information
ForteScarlet authored Jul 6, 2024
2 parents 3f3d138 + 5c2c5cf commit 41df9db
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 227 deletions.
7 changes: 7 additions & 0 deletions .changelog/v4.0.0-beta5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
> 对应核心版本: [**v4.1.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.0)

我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls)
感谢您的贡献与支持!

也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可!
99 changes: 35 additions & 64 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- v4.**.**

env:
JAVA_VERSION: 21
JAVA_DISTRIBUTION: zulu
IS_CI: true
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
Expand All @@ -14,40 +16,50 @@ env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GRADLE_OPTS: "-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
GRADLE_VERSION: 8.5


jobs:
run-test-and-publish:
name: Run test and publish
run-test:
name: Run all tests for publish
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
# 检出仓库代码
- name: Check Out Repo
uses: actions/checkout@v4

# setup Java
- name: Setup Java
uses: actions/setup-java@v4
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
cache: 'gradle'

# setup Gradle
- name: Gradle Run Test
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
arguments: assemble test -Porg.gradle.daemon=false
gradle-version: ${{ env.GRADLE_VERSION }}

# setup Gradle
- name: Publish Release
- name: Run all tests
run: gradle assemble allTests --stacktrace --warning-mode all

publish-releases:
name: Publish releases
needs: run-test
# 交叉编译 support
# see https://kotlinlang.org/docs/multiplatform-publish-lib.html#host-requirements
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
cache: 'gradle'
- name: Publish releases
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
gradle-version: ${{ env.GRADLE_VERSION }}
arguments: |
publishToSonatype
closeAndReleaseStagingRepositories
Expand All @@ -56,7 +68,6 @@ jobs:
-x test
--build-cache
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
env:
SIMBOT_IS_SNAPSHOT: false
Expand All @@ -65,66 +76,26 @@ jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
needs: run-test-and-publish
needs: publish-releases
permissions:
contents: write
steps:
# 检出仓库代码
- name: Check Out Repo
uses: actions/checkout@v4
- uses: actions/checkout@v4

# Create gitHub release
- name: Create Github Release
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.PUSH_TOKEN }}
body_path: .changelog/${{ github.ref_name }}.md
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, 'preview') || contains(github.ref_name, 'alpha') }}

# || contains(github.ref_name, 'beta')

publish-snapshot:
name: Publish snapshot
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
needs: run-test-and-publish
steps:
# 检出仓库代码
- name: Check out repo
uses: actions/checkout@v4

# setup Java
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

# setup Gradle
- name: Gradle publish snapshot
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
arguments: |
publishToSonatype
closeAndReleaseStagingRepositories
--info
--warning-mode all
-x test
--build-cache
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
env:
SIMBOT_IS_SNAPSHOT: true
SIMBOT_SNAPSHOT_ONLY: true

deploy-doc:
name: Deploy-doc
runs-on: ubuntu-latest
needs: run-test-and-publish
needs: publish-releases
steps:
# 检出仓库代码
- name: Check out repo
Expand All @@ -136,14 +107,14 @@ jobs:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}

# setup Gradle
- name: Gradle generate documentation
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
gradle-version: ${{ env.GRADLE_VERSION }}
arguments: |
dokkaHtmlMultiModule
--info
Expand Down
62 changes: 41 additions & 21 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
workflow_dispatch:

env:
JAVA_VERSION: 21
JAVA_DISTRIBUTION: zulu
IS_CI: true
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
Expand All @@ -31,45 +33,63 @@ env:
SIMBOT_IS_SNAPSHOT: true
SIMBOT_SNAPSHOT_ONLY: true
GRADLE_OPTS: "-Dfile.encoding=UTF-8"
GRADLE_VERSION: 8.5


jobs:
publish-snapshot:
name: Publish snapshot
run-test:
name: Run all tests
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
# 检出仓库代码
- name: Check out repo
uses: actions/checkout@v4

# setup Java
- name: Setup java
uses: actions/setup-java@v4
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
cache: 'gradle'

# setup Gradle
- name: Gradle test and publish snapshot
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
gradle-version: ${{ env.GRADLE_VERSION }}

- name: Gradle run all tests
run: gradle assemble allTests --stacktrace --warning-mode all

publish-snapshots:
name: Publish snapshots
needs: run-test
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
cache: 'gradle'

# setup Gradle
- name: Publish snapshots
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{ env.GRADLE_VERSION }}
arguments: |
test
publishToSonatype
closeAndReleaseStagingRepositories
--info
--warning-mode all
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
--info
--warning-mode all
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
env:
SIMBOT_IS_SNAPSHOT: true

deploy-doc:
name: Deploy-doc
runs-on: ubuntu-latest
needs: publish-snapshot
needs: publish-snapshots
steps:
# 检出仓库代码
- name: Check out repo
Expand All @@ -81,14 +101,14 @@ jobs:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}

# setup Gradle
- name: Gradle generate documentation
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
gradle-version: ${{ env.GRADLE_VERSION }}
arguments: |
-Porg.gradle.jvmargs="-Xmx4g -Xms4g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ fabric.properties
generated-docs

.kotlin
.idea
3 changes: 2 additions & 1 deletion Writerside/qg.tree
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<toc-element topic="tips-send-image.md"/>
</toc-element>
</toc-element>
<toc-element toc-title="社群信息" href="https://simbot.forte.love/communities.html" />
<toc-element toc-title="其他版本">
<toc-element toc-title="3.2.0.0">
<toc-element toc-title="快速开始">
Expand All @@ -52,4 +51,6 @@
</toc-element>
</toc-element>
</toc-element>
<toc-element toc-title="社群" href="https://simbot.forte.love/communities.html" />
<toc-element toc-title="赞助" href="https://simbot.forte.love/sponsor.html" />
</instance-profile>
2 changes: 2 additions & 0 deletions Writerside/topics/bot-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ bot开发配置中的 `Token`。

直接使用 `intents` 原始的标记位最终数值。

所有的事件对应的位值信息可前往参考 [官方文档](https://bot.q.qq.com/wiki/develop/api/gateway/intents.html)

```json
{
"type": "raw",
Expand Down
4 changes: 2 additions & 2 deletions Writerside/v.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<var name="api-doc" value="https://docs.simbot.forte.love"/>
<var name="jb" value="阻塞"/>
<var name="ja" value="异步"/>
<var name="version" value="4.0.0-beta4"/>
<var name="minimum-core-version" value="4.0.0"/>
<var name="version" value="4.0.0-beta5"/>
<var name="minimum-core-version" value="4.1.0"/>
</vars>
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ buildscript {
}
}

//group = P.ComponentTencentGuild.GROUP
//version = P.ComponentTencentGuild.versionIfSnap

logger.info("=== Current version: {} ===", version)

allprojects {
setup(P.ComponentQQGuild)
repositories {
mavenCentral()
maven {
Expand Down
13 changes: 8 additions & 5 deletions buildSrc/src/main/kotlin/JvmConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByName
import org.gradle.kotlin.dsl.withType
import org.gradle.process.CommandLineArgumentProvider
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget


@OptIn(ExperimentalKotlinGradlePluginApi::class)
inline fun KotlinJvmTarget.configJava(crossinline block: KotlinJvmTarget.() -> Unit = {}) {
withJava()
compilations.all {
kotlinOptions {
javaParameters = true
freeCompilerArgs = freeCompilerArgs + listOf("-Xjvm-default=all")
}
compilerOptions {
javaParameters.set(true)
freeCompilerArgs.addAll(
"-Xjvm-default=all"
)

}

testRuns["test"].executionTask.configure {
Expand Down
10 changes: 4 additions & 6 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
*/

import love.forte.gradle.common.core.project.ProjectDetail
import love.forte.gradle.common.core.project.Version
import love.forte.gradle.common.core.project.minus
import love.forte.gradle.common.core.property.systemProp
import love.forte.gradle.common.core.project.version as v

//val simbotVersion = v(3, 2, 0)
////- v("RC", 3)
Expand Down Expand Up @@ -59,10 +56,11 @@ object P {
override val homepage: String get() = HOMEPAGE


private val baseVersion = v(4, 0, 0) - v("beta4")
const val VERSION = "4.0.0-beta5"
const val NEXT_VERSION = "4.0.0-beta6"

val snapshotVersion = baseVersion - Version.SNAPSHOT
override val version = if (isSnapshot()) snapshotVersion else baseVersion
override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT"
override val version = if (isSnapshot()) snapshotVersion else VERSION

override val developers: List<Developer> = developers {
developer {
Expand Down
Loading

0 comments on commit 41df9db

Please sign in to comment.