Skip to content

Confine asset servlet paths to the resource root (#38590) #7

Confine asset servlet paths to the resource root (#38590)

Confine asset servlet paths to the resource root (#38590) #7

# 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:
push:
branches:
- main
paths:
- "openmetadata-service/**"
- "openmetadata-spec/src/main/resources/json/schema/**"
- "openmetadata-clients/**"
- "pom.xml"
- ".github/workflows/publish-maven-package.yml"
permissions:
contents: read
jobs:
publish-maven-packages:
runs-on: ubuntu-latest
environment: publish
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: true
- uses: actions/checkout@v7
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: 21
distribution: "temurin"
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Pin Maven 3.9.16
# ubuntu-24.04 image 20261004 ships Maven 3.10.0, whose staging layout makes
# Central reject the bundle ("Bundle has content that does NOT have a .pom file").
run: |
MVN=apache-maven-3.9.16
curl -fsSLO "https://archive.apache.org/dist/maven/maven-3/3.9.16/binaries/$MVN-bin.tar.gz"
echo "831a8591fe20c8243b1dbe7d71e3244f31d1665b0804b2e825e38cbbe5ce0cafb8338851f90780735568773e0a6cd07bbec107cda0b896b008b861075358b6f6 $MVN-bin.tar.gz" | sha512sum -c -
tar xzf "$MVN-bin.tar.gz" -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/$MVN/bin" >> "$GITHUB_PATH"
"$RUNNER_TEMP/$MVN/bin/mvn" -v
- 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: Build openmetadata-service
# Not published, but the Java client is generated from the swagger.json its compile writes.
run: mvn --no-transfer-progress --batch-mode -DskipTests -pl openmetadata-service -am install
- 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: |
# Only these modules are published; the root pom skips everything else
# (ADR:2026-10-21-maven-central-publishing-is-opt-in-per-module).
mvn \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
-pl .,common,openmetadata-spec,openmetadata-sdk,openmetadata-clients,openmetadata-clients/openmetadata-java-client \
-DskipPublishing=false \
-DskipTests -Prelease clean deploy