Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 0 additions & 89 deletions .github/workflows/auto-jdk-matrix.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/auto-jdk-os-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Auto JDK & OS Matrix Test & Install

on:
push:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]', 'v[0-9]+.[0-9]+.[Xx]']
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]', 'v[0-9]+.[0-9]+.[Xx]']
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx4g -Xms1g
MAVEN_ARGS: "-B -Dmaven.javadoc.skip=true -Dgpg.skip=true"

jobs:
build:
name: Build, Test, Install
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
jdk: [ 25 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Matrix JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-package: jdk
architecture: x64
cache: 'maven' # performance optimization
overwrite-settings: true # ensures the runner's .m2/settings.xml is current

- name: Verify Toolchain Configuration
shell: bash
run: |
if [ -f ~/.m2/toolchains.xml ]; then
cat ~/.m2/toolchains.xml
else
echo "toolchains.xml not found in ~/.m2/"
fi
- name: Echo Java & Maven Version
run: mvn -version #also prints java-version

- name: Print Current workflow
run: cat .github/workflows/auto-jdk-os-matrix.yml

- name: Test
run: mvn clean test

- name: Install
run: mvn clean install "-DskipTests=true" "-Dmaven.clean.failOnError=false" #windows os hack


# Architecture options: x86, x64, armv7, aarch64, ppc64le
# Lifecycle: validate, compile, test, package, verify, install, deploy
# -B batch mode, never stops for user input
# -V show Version without stopping
# -X debug mode
# -q quiet, only show errors
89 changes: 0 additions & 89 deletions .github/workflows/auto-os-matrix.yml

This file was deleted.

105 changes: 85 additions & 20 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,101 @@
name: JavaDoc
name: Deploy Versioned Javadoc (Manual Trigger)

# Select the target TAG where to run the workflow from.
# This TAG name becomes the subdirectory under branch gh-pages/docs/${TAG}
# where the javadocs will be copied to.
# The gh-pages/docs branch/folder must exist.

on:
workflow_dispatch:
inputs:
tag_ref:
description: 'Existing Git Tag to deploy (e.g., 1.0.0):'
required: true
default: '99.0.0' # unlikely to conflict if accidentally used. Can be left blank

jobs:
javadoc:
build-and-deploy-javadoc:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.tag_ref }} # from manual trigger input
fetch-depth: 0

- name: Setup Java
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
java-package: jdk
architecture: x64
cache: 'maven'
overwrite-settings: true # ensures the runner's .m2/settings.xml is current

- name: Echo Java Version
run: java -version
- name: Build and Generate Javadoc # POM is configured to output to target/site/apidocs
run: mvn clean javadoc:javadoc

- name: Print Current workflow
run: >
cat .github/workflows/javadoc.yml
- name: Deploy Javadoc via Worktree
env:
TAG_NAME: ${{ github.event.inputs.tag_ref }}
run: |
if [ -z "$TAG_NAME" ]; then echo "ERROR: No tag specified"; exit 1; fi

- name: Generate JavaDoc
run: mvn javadoc:javadoc
# 1. Initialize error tracking
EXIT_CODE=0

# 2. Configure Git Identity
git config user.email "noreply@github.com"
git config user.name "github-actions[bot]"

# 3. Ensure gh-pages exists and is fetched
echo "ECHO: git fetch origin gh-pages"
git fetch origin gh-pages

# 4. Create worktree for the gh-pages branch in a separate folder
echo "ECHO: git worktree add -B gh-pages ./gh-pages-dir origin/gh-pages"
git worktree add -B gh-pages ./gh-pages-dir origin/gh-pages

# 5. Deployment Logic in a subshell to capture exit code
(
set -e
TARGET_PATH="gh-pages-dir/docs/$TAG_NAME"
mkdir -p "$TARGET_PATH"

echo "ECHO: cp -a target/site/apidocs/. $TARGET_PATH/"
cp -a target/site/apidocs/. "$TARGET_PATH/"
cd gh-pages-dir

echo "ECHO: git pull origin gh-pages --rebase"
git pull origin gh-pages --rebase

echo "git add docs/$TAG_NAME"
git add "docs/$TAG_NAME"

if git diff --staged --quiet; then
echo "No changes detected for Javadoc $TAG_NAME."
else
echo "ECHO: Changes detected for Javadoc $TAG_NAME."
echo "ECHO: git commit ..."
git commit -m "Manual Javadoc deployment for tag $TAG_NAME"
echo "ECHO: git push origin gh-pages"
git push origin gh-pages
fi
) || EXIT_CODE=$?

# 6. Cleanup (Always runs)
echo "ECHO: Cleaning up worktree..."
git worktree remove --force ./gh-pages-dir || true

# 7. Final exit based on subshell success
exit $EXIT_CODE

- name: Confirm Deployment
if: success()
run: |
echo "ECHO: Javadoc for ${{ github.event.inputs.tag_ref }} is now live on gh-pages."

- name: Deploy JavaDoc
uses: JamesIves/github-pages-deploy-action@v4.6.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: target/reports/apidocs
target-folder: docs/${{ github.ref_name }}
branch: gh-pages
13 changes: 13 additions & 0 deletions DS-Java-Memory-24.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"folders": [
{
"path": "."
},
{
"path": "../datasketches-java21"
}
],
"settings": {
"maven.view": "flat"
}
}
Loading