Skip to content

Merge pull request #94 from livk-cloud/renovate/com.clickhouse-clickh… #226

Merge pull request #94 from livk-cloud/renovate/com.clickhouse-clickh…

Merge pull request #94 from livk-cloud/renovate/com.clickhouse-clickh… #226

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with mvnd
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
# 获取 mvnd 最新 release 版本号
- name: Get mvnd latest release
id: mvnd_release
run: |
LATEST=$(curl -s https://api.github.com/repos/apache/maven-mvnd/releases/latest | jq -r .tag_name)
echo "version=$LATEST" >> $GITHUB_OUTPUT
# 缓存 mvnd 仅限解压后的版本目录(避免日志和临时文件)
- name: Cache mvnd binaries
uses: actions/cache@v5
with:
path: ~/.mvnd/maven-mvnd-${{ steps.mvnd_release.outputs.version }}-linux-amd64
key: mvnd-${{ runner.os }}-${{ steps.mvnd_release.outputs.version }}
# 安装 mvnd(如果缓存里没有)
- name: Install mvnd
run: |
VERSION=${{ steps.mvnd_release.outputs.version }}
if [ ! -d "$HOME/.mvnd/maven-mvnd-${VERSION}-linux-amd64" ]; then
curl -L "https://github.com/apache/maven-mvnd/releases/download/${VERSION}/maven-mvnd-${VERSION}-linux-amd64.zip" -o mvnd.zip
unzip -o mvnd.zip -d ~/.mvnd
fi
# 把 mvnd 加到 PATH(避免重复写入)
- name: Add mvnd to PATH
run: |
VERSION=${{ steps.mvnd_release.outputs.version }}
BIN="$HOME/.mvnd/maven-mvnd-${VERSION}-linux-amd64/bin"
if ! grep -qxF "$BIN" "$GITHUB_PATH"; then
echo "$BIN" >> $GITHUB_PATH
fi
# 缓存 Maven 仓库
- name: Cache Maven repository
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: Build with mvnd
run: mvnd -B clean package --file pom.xml