mirror of
https://github.com/CarmJos/MineSQL.git
synced 2024-09-19 20:25:45 +00:00
ci(deploy): 支持三处同时部署
This commit is contained in:
parent
2321ed35c2
commit
5ecd7f54e2
27
.doc/repository/REPO-README.md
Normal file
27
.doc/repository/REPO-README.md
Normal file
@ -0,0 +1,27 @@
|
||||
# MineSQL Repository
|
||||
|
||||
采用github的repo分支进行依赖,随项目发布而自动更新。
|
||||
|
||||
其他依赖方式见主页介绍。
|
||||
|
||||
## 依赖方式
|
||||
|
||||
### Maven
|
||||
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>MineSQL</id>
|
||||
<name>GitHub Branch Repository</name>
|
||||
<url>https://github.com/CarmJos/MineSQL/blob/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
|
||||
### Gradle
|
||||
|
||||
```groovy
|
||||
repositories {
|
||||
maven { url 'https://github.com/CarmJos/MineSQL/blob/repo/' }
|
||||
}
|
||||
```
|
76
.github/workflows/deploy.yml
vendored
76
.github/workflows/deploy.yml
vendored
@ -8,7 +8,7 @@ on:
|
||||
types: [ published ]
|
||||
|
||||
jobs:
|
||||
gh-deploy:
|
||||
packages-deploy:
|
||||
name: "Deploy Project (GitHub)"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -43,6 +43,80 @@ jobs:
|
||||
asset_path: ".asset/*.jar"
|
||||
asset_content_type: application/java-archive
|
||||
|
||||
github-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: "Set up JDK"
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
cache: maven
|
||||
|
||||
- name: "Maven Deploy"
|
||||
run: mvn -B -Plocal deploy --file pom.xml -DskipTests
|
||||
|
||||
- name: "Copy artifacts"
|
||||
run: |
|
||||
rm -rf deploy
|
||||
mkdir -vp deploy
|
||||
cp -vrf $HOME/local-deploy/* deploy/
|
||||
cp -vrf .documentation/repository/REPO-README.md deploy/README.md
|
||||
|
||||
- name: "Copy Javadoc"
|
||||
run: |
|
||||
rm -rf docs
|
||||
mkdir -vp docs
|
||||
cp -vrf api/target/apidocs/* docs/
|
||||
cp -vrf .documentation/javadoc/JAVADOC-README.md docs/README.md
|
||||
|
||||
- name: "Generate Javadoc sitemap"
|
||||
id: sitemap
|
||||
uses: cicirello/generate-sitemap@v1
|
||||
with:
|
||||
base-url-path: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
|
||||
path-to-root: docs
|
||||
|
||||
- name: "Output Javadoc stats"
|
||||
run: |
|
||||
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
|
||||
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
|
||||
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
|
||||
ls -l docs
|
||||
|
||||
- name: "Configure Git"
|
||||
env:
|
||||
DEPLOY_PRI: ${{secrets.DEPLOY_PRI}}
|
||||
run: |
|
||||
sudo timedatectl set-timezone "Asia/Shanghai"
|
||||
mkdir -p ~/.ssh/
|
||||
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
git config --global user.name '${{ github.repository_owner }}'
|
||||
git config --global user.email '${{ github.repository_owner }}@users.noreply.github.com'
|
||||
|
||||
- name: "Commit&Push repository files"
|
||||
run: |
|
||||
cd deploy
|
||||
git init
|
||||
git remote add origin git@github.com:${{ github.repository_owner }}/${{ github.event.repository.name }}.git
|
||||
git checkout -b repo
|
||||
git add -A
|
||||
git commit -m "Maven project deployment."
|
||||
git push origin HEAD:repo --force
|
||||
|
||||
- name: "Commit&Push API documentation"
|
||||
run: |
|
||||
cd docs
|
||||
git init
|
||||
git remote add origin git@github.com:${{ github.repository_owner }}/${{ github.event.repository.name }}.git
|
||||
git checkout -b gh-pages
|
||||
git add -A
|
||||
git commit -m "API Document generated."
|
||||
git push origin HEAD:gh-pages --force
|
||||
|
||||
central-deploy:
|
||||
name: "Deploy Project (Central)"
|
||||
runs-on: ubuntu-latest
|
||||
|
15
README.md
15
README.md
@ -7,6 +7,7 @@
|
||||
```
|
||||
|
||||
# MineSQL (EasySQL-Plugin)
|
||||
|
||||
[![version](https://img.shields.io/github/v/release/CarmJos/MineSQL)](https://github.com/CarmJos/MineSQL/releases)
|
||||
[![License](https://img.shields.io/github/license/CarmJos/MineSQL)](https://opensource.org/licenses/GPL-3.0)
|
||||
[![workflow](https://github.com/CarmJos/MineSQL/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/MineSQL/actions/workflows/maven.yml)
|
||||
@ -89,12 +90,12 @@ Properties 文件的文件名几位数据源的ID,允许为英文、数字、
|
||||
<name>Maven Central</name>
|
||||
<url>https://repo1.maven.org/maven2</url>
|
||||
</repository>
|
||||
|
||||
|
||||
<repository>
|
||||
<!--采用github依赖库,安全稳定,但需要配置 (推荐)-->
|
||||
<!--采用github分支依赖库,稳定更新快-->
|
||||
<id>MineSQL</id>
|
||||
<name>GitHub Packages</name>
|
||||
<url>https://maven.pkg.github.com/CarmJos/MineSQL</url>
|
||||
<name>GitHub Branch Repository</name>
|
||||
<url>https://github.com/CarmJos/MineSQL/blob/repo/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
@ -130,8 +131,8 @@ repositories {
|
||||
//采用Maven中心库,安全稳定,但版本更新需要等待同步
|
||||
mavenCentral()
|
||||
|
||||
// 采用github依赖库,安全稳定,但需要配置 (推荐)
|
||||
maven { url 'https://maven.pkg.github.com/CarmJos/MineSQL' }
|
||||
// 采用github分支依赖库,稳定更新快
|
||||
maven { url 'https://github.com/CarmJos/MineSQL/blob/repo/' }
|
||||
|
||||
// 采用我的私人依赖库,简单方便,但可能因为变故而无法使用
|
||||
maven { url 'https://repo.carm.cc/repository/maven-public/' }
|
||||
@ -146,7 +147,7 @@ dependencies {
|
||||
|
||||
## 指令
|
||||
|
||||
插件主指令为 `/easysql` ,所有指令只允许后台执行。
|
||||
插件主指令为 `/minesql` ,所有指令只允许后台执行。
|
||||
|
||||
```text
|
||||
# help
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
|
15
pom.xml
15
pom.xml
@ -24,7 +24,7 @@
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
<modules>
|
||||
<module>api</module>
|
||||
<module>core</module>
|
||||
@ -302,6 +302,19 @@
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>local</id>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>localRepository</id>
|
||||
<url>file:${user.home}/local-deploy/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>localRepository</id>
|
||||
<url>file:${user.home}/local-deploy/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user