mirror of
https://github.com/CarmJos/UserPrefix.git
synced 2024-09-19 20:15:47 +00:00
添加packages自动部署
This commit is contained in:
parent
313aa77d72
commit
3a41560972
21
.github/workflows/maven.yml
vendored
21
.github/workflows/maven.yml
vendored
@ -4,10 +4,11 @@
|
|||||||
name: Maven
|
name: Maven
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
# 支持手动触发构建
|
||||||
branches: [ master ]
|
workflow_dispatch:
|
||||||
pull_request:
|
release:
|
||||||
branches: [ master ]
|
# 创建release的时候触发
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -22,10 +23,16 @@ jobs:
|
|||||||
java-version: '11'
|
java-version: '11'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
cache: maven
|
cache: maven
|
||||||
- name: Build with Maven
|
- name: run Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn -B deploy --file pom.xml
|
||||||
|
with:
|
||||||
|
server-id: github
|
||||||
|
# Nexus用户名环境变量
|
||||||
|
server-username: ${{ secrets.MAVEN_USERNAME }}
|
||||||
|
# Nexus密码环境变量
|
||||||
|
server-password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: mkdir staging && cp target/*.jar staging
|
- run: mkdir staging && cp target/*.jar staging
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Package
|
name: artifact
|
||||||
path: staging
|
path: staging
|
9
pom.xml
9
pom.xml
@ -11,7 +11,6 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
<maven.deploy.skip>true</maven.deploy.skip>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
</properties>
|
</properties>
|
||||||
@ -49,6 +48,14 @@
|
|||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>github</id>
|
||||||
|
<name>GitHub Packages</name>
|
||||||
|
<url>https://maven.pkg.github.com/CarmJos/UserPrefix</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
Loading…
Reference in New Issue
Block a user