Skip to content

Maven Publish

Maven Publish #20

Workflow file for this run

# Copyright 2023 Greptime Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Maven Publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the code
- uses: actions/checkout@v4
# Step 2: Set up the Java environment
- uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
server-id: ossrh
server-username: ${{ secrets.MAVEN_USERNAME }}
server-password: ${{ secrets.MAVEN_PASSWORD }}
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
# Step 3: Verify if the GPG key is correctly imported
- name: Verify GPG Key
run: gpg --list-secret-keys --keyid-format LONG
# Step 4: Build and publish using Maven
- name: Build and Publish with Maven
run: mvn clean deploy --batch-mode -DskipTests -P release -B -U -e
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}