Skip to content

build: more automated, modular shared libs #21

build: more automated, modular shared libs

build: more automated, modular shared libs #21

Workflow file for this run

name: Build preview shared lib plugins
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Build and upload plugins dynamically
run: |
chmod +x ./gradlew
mkdir -p plugin/build/libs
for dir in plugin/*/; do
if [ -d "$dir" ]; then
dir_name=$(basename "$dir")
echo "Building $dir_name"
./gradlew :plugin:"$dir_name":shadowJar
output_dir="plugin/$dir_name/build/libs"
jar_file=$(ls $output_dir/*.jar | grep -E ".*-all\.jar$")
if [ -z "$jar_file" ]; then
echo "No JAR file found in $output_dir for $dir_name"
exit 1
fi
base_name=$(basename "$jar_file" -all.jar)
new_name="plugin/build/libs/kotlinx-${base_name}-${GITHUB_SHA}.jar"
mv "$jar_file" "$new_name"
echo "Uploading artifact $new_name"
artifact_name="${base_name}-${GITHUB_SHA}"
gh run upload-artifact --name "$artifact_name" --path "$new_name"
else
echo "Skipping non-directory: $dir"
fi
done