Skip to content

Commit

Permalink
添加自动构建配置
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Mar 14, 2022
1 parent 1fa1956 commit c6aa561
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bugs_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: 问题提交
about: 提交并描述问题,帮助我们对其进行检查与修复。
title: ''
labels: bug
assignees: ''

---

**问题简述**
<!--用简短的话语描述一下大概问题。-->

**问题来源**
<!--
描述一下通过哪些操作才发现的问题,如:
1. 打开 '...'
2. 点击了 '....'
3. 出现了报错 '....'
-->

**预期结果**(可选)
<!--如果问题不发生,应该是什么情况-->

**问题截图/问题报错**
<!--如果有报错或输出,请提供截图。-->

**操作环境**
<!--请在后台输入 `version` 并复制相关输出。-->


**其他补充**
<!--如有其他补充,可以在这里描述。-->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: 功能需求
about: 希望我们提供更多的功能。
title: ''
labels: enhancement
assignees: ''

---

**功能简述**
<!--简单的描述一下你想要的功能-->

**需求来源**
<!--简单的描述一下为什么需要这个功能。-->

**功能参考**(可选)
<!--如果有相关功能的参考,如文本、截图,请提供给我们。-->

**附加内容**
<!--如果有什么小细节需要重点注意,请在这里告诉我们。-->
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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

name: Deploy & Upload

on:
# 支持手动触发构建
workflow_dispatch:
release:
# 创建release的时候触发
types: [ published ]

jobs:
build:

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
server-id: github
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN

- name: "Maven Deploy"
run: mvn -B deploy --file pom.xml -DskipTests
env:
MAVEN_USERNAME: ${{ github.repository_owner }}
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: "Release Asset Upload"
id: upload-release-asset
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: asset/*.jar
asset_content_type: application/java-archive
43 changes: 43 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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

name: Build & Tests

on:
# 支持手动触发构建
workflow_dispatch:
push:

jobs:
build:

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
server-id: github
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
- name: "Package"
run: mvn -B package --file pom.xml -Dmaven.javadoc.skip=true
env:
MAVEN_USERNAME: ${{ github.repository_owner }}
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: artifact
path: target

- name: "Upload assets"
uses: actions/upload-artifact@v3
with:
name: assets
path: asset
50 changes: 43 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@
<scope>provided</scope>
</dependency>
</dependencies>


<distributionManagement>
<downloadUrl>https://github.com/NyaWorld/canvas/releases</downloadUrl>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/NyaWorld/canvas</url>
</repository>
</distributionManagement>


<build>
<plugins>
<plugin>
Expand All @@ -42,15 +52,41 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>org.ipvp.canvas</Automatic-Module-Name>
</manifestEntries>
</archive>
<classifier>javadoc</classifier>
<links>
<link>https://javadoc.io/doc/org.jetbrains/annotations/</link>
</links>
<detectJavaApiLink>true</detectJavaApiLink>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit c6aa561

Please sign in to comment.