mirror of
https://github.com/CarmJos/EasySQL.git
synced 2026-06-04 15:28:20 +08:00
ci(deploy): 修改部署配置
This commit is contained in:
@@ -11,7 +11,7 @@ on:
|
|||||||
types: [ published ]
|
types: [ published ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
gh-deploy:
|
packages-deploy:
|
||||||
name: "Publish Project (GitHub Packages)"
|
name: "Publish Project (GitHub Packages)"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -28,14 +28,63 @@ jobs:
|
|||||||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
|
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
|
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
|
||||||
|
|
||||||
- name: "Maven Deploy With Javadoc"
|
- name: "Packages Deploy"
|
||||||
run: mvn -B -Pgithub deploy --file pom.xml -DskipTests
|
run: mvn -B -Pgithub deploy --file pom.xml -DskipTests
|
||||||
env:
|
env:
|
||||||
MAVEN_USERNAME: ${{ github.repository_owner }}
|
MAVEN_USERNAME: ${{ github.repository_owner }}
|
||||||
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
||||||
|
|
||||||
- name: "Copy Javadoc to Location"
|
central-deploy:
|
||||||
|
name: "Deploy Project (Central Repository)"
|
||||||
|
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: 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 }}
|
||||||
|
|
||||||
|
github-deploy:
|
||||||
|
name: "Deploy Project (GitHub Repository)"
|
||||||
|
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
|
||||||
|
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: "Maven Deploy"
|
||||||
|
run: mvn -B -Plocal deploy --file pom.xml -DskipTests
|
||||||
|
env:
|
||||||
|
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
||||||
|
|
||||||
|
- name: "Copy artifacts"
|
||||||
|
run: |
|
||||||
|
rm -rf deploy
|
||||||
|
mkdir -vp deploy
|
||||||
|
cp -vrf $HOME/local-deploy/* deploy/
|
||||||
|
|
||||||
|
- name: "Copy Javadoc"
|
||||||
run: |
|
run: |
|
||||||
rm -rf docs
|
rm -rf docs
|
||||||
mkdir -vp docs
|
mkdir -vp docs
|
||||||
@@ -67,82 +116,7 @@ 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 documentations"
|
- name: "Commit&Push repository files"
|
||||||
run: |
|
|
||||||
cd docs
|
|
||||||
git init
|
|
||||||
git remote add origin git@github.com:${{ github.repository_owner }}/${{ github.event.repository.name }}.git
|
|
||||||
git checkout -b gh-pages
|
|
||||||
git add -A
|
|
||||||
git commit -m "API Document generated."
|
|
||||||
|
|
||||||
- name: "Push javadocs"
|
|
||||||
run: |
|
|
||||||
cd docs
|
|
||||||
git push origin HEAD:gh-pages --force
|
|
||||||
|
|
||||||
central-deploy:
|
|
||||||
name: "Deploy Project (Central Repository)"
|
|
||||||
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: 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 }}
|
|
||||||
|
|
||||||
local-deploy:
|
|
||||||
name: "Deploy Project (GitHub Repository)"
|
|
||||||
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
|
|
||||||
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: "Maven Deploy"
|
|
||||||
run: mvn -B -Plocal deploy --file pom.xml -DskipTests
|
|
||||||
env:
|
|
||||||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
|
||||||
|
|
||||||
- name: "Copy artifacts"
|
|
||||||
run: |
|
|
||||||
rm -rf deploy
|
|
||||||
mkdir -vp deploy
|
|
||||||
cp -vrf $HOME/local-deploy/* deploy/
|
|
||||||
|
|
||||||
- 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: |
|
run: |
|
||||||
cd deploy
|
cd deploy
|
||||||
git init
|
git init
|
||||||
@@ -150,8 +124,14 @@ jobs:
|
|||||||
git checkout -b repo
|
git checkout -b repo
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "Maven project deployment."
|
git commit -m "Maven project deployment."
|
||||||
|
|
||||||
- name: "Push files"
|
|
||||||
run: |
|
|
||||||
cd deploy
|
|
||||||
git push origin HEAD:repo --force
|
git push origin HEAD:repo --force
|
||||||
|
|
||||||
|
- name: "Commit&Push documentations"
|
||||||
|
run: |
|
||||||
|
cd docs
|
||||||
|
git init
|
||||||
|
git remote add origin git@github.com:${{ github.repository_owner }}/${{ github.event.repository.name }}.git
|
||||||
|
git checkout -b gh-pages
|
||||||
|
git add -A
|
||||||
|
git commit -m "API documentation deployment."
|
||||||
|
git push origin HEAD:gh-pages --force
|
||||||
Reference in New Issue
Block a user