From 3a41560972777782dfae0e08d906fe31f8e69dad Mon Sep 17 00:00:00 2001 From: carm Date: Thu, 7 Oct 2021 21:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0packages=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maven.yml | 23 +++++++++++++++-------- pom.xml | 9 ++++++++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5c9c927..e6c8077 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -4,10 +4,11 @@ name: Maven on: - push: - branches: [ master ] - pull_request: - branches: [ master ] + # 支持手动触发构建 + workflow_dispatch: + release: + # 创建release的时候触发 + types: [ published ] jobs: build: @@ -22,10 +23,16 @@ jobs: java-version: '11' distribution: 'adopt' cache: maven - - name: Build with Maven - run: mvn -B package --file pom.xml + - name: run Maven + 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 - uses: actions/upload-artifact@v2 with: - name: Package - path: staging + name: artifact + path: staging \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6f6a295..53e16b8 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,6 @@ 8 8 - true UTF-8 UTF-8 @@ -49,6 +48,14 @@ + + + github + GitHub Packages + https://maven.pkg.github.com/CarmJos/UserPrefix + + +