1
mirror of https://github.com/CarmJos/MineConfiguration.git synced 2024-09-19 20:05:49 +00:00
MineConfiguration/.github/workflows/deploy.yml

62 lines
2.2 KiB
YAML
Raw Normal View History

2022-04-21 02:32:45 +00:00
# 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
2022-04-22 05:47:02 +00:00
name: "Deploy & Publish"
2022-04-21 02:32:45 +00:00
on:
# 支持手动触发构建
workflow_dispatch:
release:
# 创建release的时候触发
types: [ published ]
jobs:
gh-deploy:
2022-05-28 04:43:32 +00:00
name: "Deploy Project (GitHub)"
2022-04-21 02:32:45 +00:00
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 # Say 4uck u to github cache services.
2022-04-21 02:32:45 +00:00
server-id: github
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
2022-04-23 15:27:21 +00:00
- name: "Maven Deploy"
2022-04-21 02:32:45 +00:00
run: mvn -B -Pgithub deploy --file pom.xml -DskipTests
env:
MAVEN_USERNAME: ${{ github.repository_owner }}
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
central-deploy:
2022-05-28 04:43:32 +00:00
name: "Deploy Project (Central)"
2022-04-21 02:32:45 +00:00
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 # Say 4uck u to github cache services.
2022-04-21 02:32:45 +00:00
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: "Central Deploy"
run: mvn -B -Possrh deploy --file pom.xml -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}