Skip to content

publish

publish #16

on:
workflow_dispatch:
inputs:
version:
description: 'Version number to be released this time'
required: true
name: publish
env:
version: ${{ inputs.version }}
jobs:
publish:
name: publish Maven central warehouse
runs-on: ubuntu-latest
steps:
- name: Checkout Source # 检出代码
uses: actions/checkout@v3
- name: Set up JDK 8 # 构建jdk运行环境
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: set version
run: |
mvn versions:set -DnewVersion='${{ env.version }}'
- name: Install secret key
run: |
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: publish agentCore
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
cd ${{ github.workspace }}/sermant-agentcore
mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_SECRET_KEY_PASSWORD }} clean deploy -P release -DskipTests
- name: install
run: |
cd ${{ github.workspace }}
mvn clean install -DskipTests
- name: publish plugin
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
cd ${{ github.workspace }}
mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_SECRET_KEY_PASSWORD }} clean deploy -P release -DskipTests