mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 12:36:56 +00:00
76 lines
2.7 KiB
YAML
76 lines
2.7 KiB
YAML
# Copyright 2021 Collate
|
|
# 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: Publish Package to Maven Central Repository
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
pull_request_target:
|
|
types:
|
|
- closed
|
|
paths:
|
|
- "openmetadata-service/**"
|
|
- "openmetadata-spec/src/main/resources/json/schema/**"
|
|
- "openmetadata-clients/**"
|
|
- "pom.xml"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
publish:
|
|
if: github.event.pull_request.merged == true
|
|
runs-on: ubuntu-latest
|
|
environment: publish
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: 11
|
|
distribution: 'adopt'
|
|
server-id: ossrh
|
|
server-username: MAVEN_USERNAME
|
|
server-password: MAVEN_PASSWORD
|
|
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
|
|
gpg-passphrase: MAVEN_GPG_PASSPHRASE
|
|
|
|
- name: Install Ubuntu dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \
|
|
librdkafka-dev unixodbc-dev libevent-dev
|
|
- name: Setup Test Containers Properties
|
|
run: |
|
|
sudo make install_antlr_cli
|
|
echo 'testcontainers.reuse.enable=true' >> $HOME/.testcontainers.properties
|
|
- name: Setup settings-security.xml
|
|
run: |
|
|
rm -rf ~/.m2/settings-security.xml
|
|
echo "<settingsSecurity><master>${{ secrets.MAVEN_MASTER_PASSWORD }}</master></settingsSecurity>" > ~/.m2/settings-security.xml
|
|
- name: Install gpg secret key
|
|
run: |
|
|
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
|
|
gpg --list-secret-keys --keyid-format LONG
|
|
- name: Publish to Central Repository
|
|
env:
|
|
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
|
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
|
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
|
|
run: |
|
|
mvn \
|
|
--no-transfer-progress \
|
|
--batch-mode \
|
|
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
|
|
-DskipTests -Prelease clean deploy
|