mirror of
https://github.com/CarmJos/EasyPlugin.git
synced 2026-06-04 16:48:16 +08:00
ci(deploy): 简化部署流程
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
# EasyPlugin Repository
|
||||||
|
|
||||||
|
采用github的repo分支进行依赖,随项目发布而自动更新。
|
||||||
|
|
||||||
|
其他依赖方式见主页介绍。
|
||||||
|
|
||||||
|
## 依赖方式
|
||||||
|
|
||||||
|
### Maven
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>EasyPlugin</id>
|
||||||
|
<name>GitHub Branch Repository</name>
|
||||||
|
<url>https://github.com/CarmJos/EasyPlugin/blob/repo/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Gradle
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
repositories {
|
||||||
|
maven { url 'https://github.com/CarmJos/EasyPlugin/blob/repo/' }
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||||
|
|
||||||
name: Project Deployment
|
name: Deploy & Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# 支持手动触发构建
|
# 支持手动触发构建
|
||||||
@@ -11,10 +11,8 @@ on:
|
|||||||
types: [ published ]
|
types: [ published ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
github-deploy:
|
packages-deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: "Set up JDK"
|
- name: "Set up JDK"
|
||||||
@@ -34,10 +32,8 @@ jobs:
|
|||||||
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|
||||||
|
|
||||||
local-deploy:
|
github-deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: "Set up JDK"
|
- name: "Set up JDK"
|
||||||
@@ -55,45 +51,7 @@ jobs:
|
|||||||
rm -rf deploy
|
rm -rf deploy
|
||||||
mkdir -vp deploy
|
mkdir -vp deploy
|
||||||
cp -vrf $HOME/local-deploy/* deploy/
|
cp -vrf $HOME/local-deploy/* deploy/
|
||||||
|
cp -vrf .documentation/repository/REPO-README.md deploy/README.md
|
||||||
- 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 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."
|
|
||||||
|
|
||||||
- name: "Push files"
|
|
||||||
run: |
|
|
||||||
cd deploy
|
|
||||||
git push origin HEAD:repo --force
|
|
||||||
|
|
||||||
javadoc-deploy:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: "Set up JDK"
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
java-version: '8'
|
|
||||||
distribution: 'adopt'
|
|
||||||
cache: maven
|
|
||||||
|
|
||||||
- name: "Generate Javadoc"
|
- name: "Generate Javadoc"
|
||||||
run: mvn -B javadoc:aggregate --file pom.xml -DskipTests
|
run: mvn -B javadoc:aggregate --file pom.xml -DskipTests
|
||||||
@@ -105,14 +63,14 @@ jobs:
|
|||||||
cp -vrf target/site/apidocs/* docs/
|
cp -vrf target/site/apidocs/* docs/
|
||||||
cp -vrf .documentation/javadoc/JAVADOC-README.md docs/README.md
|
cp -vrf .documentation/javadoc/JAVADOC-README.md docs/README.md
|
||||||
|
|
||||||
- name: "Generate Sitemap"
|
- name: "Generate Javadoc sitemap"
|
||||||
id: sitemap
|
id: sitemap
|
||||||
uses: cicirello/generate-sitemap@v1
|
uses: cicirello/generate-sitemap@v1
|
||||||
with:
|
with:
|
||||||
base-url-path: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
|
base-url-path: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
|
||||||
path-to-root: docs
|
path-to-root: docs
|
||||||
|
|
||||||
- name: Output stats
|
- name: "Output Javadoc stats"
|
||||||
run: |
|
run: |
|
||||||
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
|
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
|
||||||
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
|
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
|
||||||
@@ -131,7 +89,17 @@ jobs:
|
|||||||
git config --global user.name '${{ github.repository_owner }}'
|
git config --global user.name '${{ github.repository_owner }}'
|
||||||
git config --global user.email '${{ github.repository_owner }}@users.noreply.github.com'
|
git config --global user.email '${{ github.repository_owner }}@users.noreply.github.com'
|
||||||
|
|
||||||
- name: "Commit documentation"
|
- 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: |
|
run: |
|
||||||
cd docs
|
cd docs
|
||||||
git init
|
git init
|
||||||
@@ -139,8 +107,4 @@ jobs:
|
|||||||
git checkout -b gh-pages
|
git checkout -b gh-pages
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "API Document generated."
|
git commit -m "API Document generated."
|
||||||
|
|
||||||
- name: "Push Javadoc website"
|
|
||||||
run: |
|
|
||||||
cd docs
|
|
||||||
git push origin HEAD:gh-pages --force
|
git push origin HEAD:gh-pages --force
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||||
|
|
||||||
name: Project Build & Tests
|
name: Build & Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# 支持手动触发构建
|
# 支持手动触发构建
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
cache: maven
|
cache: maven
|
||||||
java-version: '11'
|
java-version: '8'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
server-id: github
|
server-id: github
|
||||||
server-username: MAVEN_USERNAME
|
server-username: MAVEN_USERNAME
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<artifactId>easyplugin-parent</artifactId>
|
<artifactId>easyplugin-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.4.4</version>
|
<version>1.4.5</version>
|
||||||
<modules>
|
<modules>
|
||||||
|
|
||||||
<module>base/main</module>
|
<module>base/main</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user