Skip to content

Commit

Permalink
CI配置、发布配置增加与修改
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Apr 9, 2024
1 parent 2f01e92 commit 9d4c48d
Show file tree
Hide file tree
Showing 11 changed files with 461 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
blank_issues_enabled: true

contact_links:
- name: 问题反馈 / Report
- name: 问题反馈 / Bug Report
url: https://github.com/simple-robot/simpler-robot/issues/new/choose
about: 通过simbot核心库issues统一反馈组件问题
about: 前往simbot问题统一反馈处 / Go to the summary of simbot issues

- name: 社区 / Discussions
- name: 讨论区 / Discussions
url: https://github.com/orgs/simple-robot/discussions
about: GitHub交流讨论区
about: simbot交流讨论区
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "📃文档反馈 / Documentation Feedback"
description: "反馈与文档、网站内容相关的问题反馈"
labels: [ "文档" ]
assignees: [ "ForteScarlet" ]
# https://docs.github.com/cn/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
body:
- type: markdown
attributes:
value: |
## Notes
在进行问题反馈前,请**确认**以下内容: / Please **confirm** the following before reporting an issue:
1. 我确认目前的 [issues](https://github.com/simple-robot/simbot-component-telegram/issues?q=is%3Aissue+label%3A%E6%96%87%E6%A1%A3)
(和 [core-issues](https://github.com/simple-robot/simpler-robot/issues?q=is%3Aissue+label%3A%E7%BB%84%E4%BB%B6%3ATelegram+))
中没有类似内容。
2. 我已确认所述内容不涉及任何个人隐私或其他敏感信息,遵守相关地区法律法规。
反馈的内容请尽量使用中文、或易于翻译的英文。
Please use Chinese or easily translatable English as much as possible.
<hr />
- type: dropdown
id: type
attributes:
label: 反馈内容类型 / Type of feedback content
options:
- 网站
- API文档
- 其他
validations:
required: true

- type: textarea
id: links
attributes:
label: 相关链接 / Related Links
description: 提供可用的相关链接

- type: textarea
id: description
attributes:
label: 内容描述 / Description
description: 描述你的反馈内容
validations:
required: true
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "🔥问题反馈 / Problem Feedback"
description: "反馈遇到的BUG或问题"
labels: [ "bug?" ]
assignees: [ "ForteScarlet" ]
# https://docs.github.com/cn/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
body:
- type: markdown
attributes:
value: |
## Notes
在进行问题反馈前,请**确认**以下内容: / Please **confirm** the following before reporting an issue:
1. 我确认目前的 [issues](https://github.com/simple-robot/simbot-component-telegram/issues?q=is%3Aissue+label%3Abug%3F)
(和 [core-issues](https://github.com/simple-robot/simpler-robot/issues?q=is%3Aissue+label%3A%E7%BB%84%E4%BB%B6%3ATelegram))
中没有类似内容。
2. 我已确认所述内容不涉及任何个人隐私或其他敏感信息,遵守相关地区法律法规。
反馈的内容请尽量使用中文、或易于翻译的英文。
Please use Chinese or easily translatable English as much as possible.
<hr />
- type: dropdown
id: language
attributes:
label: 使用的语言 / Language used
options:
- Java
- Kotlin
- 其他
validations:
required: true

- type: dropdown
id: build-tool
attributes:
label: 使用的构建工具 / Build tool
options:
- Maven
- Gradle
- 其他
validations:
required: true

- type: textarea
id: description
attributes:
label: 内容描述 / Description
description: 描述你的反馈内容
validations:
required: true
165 changes: 165 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: Publish Release
on:
push:
tags:
- v*.**.**

env:
IS_CI: true
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
OSSRH_USER: ${{ secrets.SONATYPE_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GRADLE_OPTS: "-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"


jobs:
run-test-and-publish:
name: Run test and 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
with:
distribution: 'zulu'
java-version: 21
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

# setup Gradle
- name: Publish Release
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
arguments: |
publishToSonatype
closeAndReleaseStagingRepository
--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: false
SIMBOT_RELEASES_ONLY: true

create-release:
name: Create release
runs-on: ubuntu-latest
needs: run-test-and-publish
permissions:
contents: write
steps:
# 检出仓库代码
- name: Check Out Repo
uses: actions/checkout@v4

# Create gitHub release
- name: Create Github Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.PUSH_TOKEN }}
body: '${{ github.ref_name }}'
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
closeAndReleaseStagingRepository
--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
steps:
# 检出仓库代码
- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
# setup Java
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

# setup Gradle
- name: Gradle generate documentation
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
arguments: |
dokkaHtmlMultiModule
--info
--warning-mode all
-x test
--build-cache
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
- name: Push to doc repository
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PUSH_TOKEN }}
external_repository: simple-robot-library/simbot3-api-docs
publish_branch: kdoc-deploy/component-telegram
publish_dir: ./build/dokka/html
# deploy to sub dir
destination_dir: components/telegram
111 changes: 111 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish Snapshot
on:
push:
branches:
- main
- master
- dev/ver/**
- dev/main
paths:
- 'buildSrc'
- '**src/**/kotlin/**.kt'
- '**src/**/java/**.java'
- '**/src/**/kotlin/**.kt'
- '**/src/**/java/**.java'
- '**/build.gradle.kts'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle.properties'

# 手动触发工作流
workflow_dispatch:

env:
IS_CI: true
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
OSSRH_USER: ${{ secrets.SONATYPE_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIMBOT_IS_SNAPSHOT: true
SIMBOT_SNAPSHOT_ONLY: true
GRADLE_OPTS: "-Dfile.encoding=UTF-8"


jobs:
publish-snapshot:
name: Publish snapshot
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
with:
distribution: 'zulu'
java-version: 21

# setup Gradle
- name: Gradle test and publish snapshot
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
arguments: |
allTests
publishToSonatype
closeAndReleaseStagingRepository
--info
--warning-mode all
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
deploy-doc:
name: Deploy-doc
runs-on: ubuntu-latest
needs: publish-snapshot
steps:
# 检出仓库代码
- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
# setup Java
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

# setup Gradle
- name: Gradle generate documentation
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.5
arguments: |
-Porg.gradle.jvmargs="-Xmx4g -Xms4g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
-DisSnapshot=false
--info
--warning-mode all
-x test
--build-cache
dokkaHtmlMultiModule
- name: Push to doc repository
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PUSH_TOKEN }}
external_repository: simple-robot-library/simbot3-api-docs
publish_branch: kdoc-deploy/snapshots/component-telegram
publish_dir: ./build/dokka/html
# deploy to sub dir
destination_dir: snapshots/components/telegram
Loading

0 comments on commit 9d4c48d

Please sign in to comment.