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
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: ci

on:
push:
branches:
- dev
pull_request:
branches:
- master
- main
- dev
workflow_dispatch:

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

jobs:
build:
name: Build & integration-test ${{ matrix.distribution }} JDK ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: '8'
distribution: temurin
- target: '11'
distribution: temurin
- target: '17'
distribution: temurin
- target: '21'
distribution: oracle
steps:
- uses: actions/checkout@v4

- name: Set up target ${{ matrix.distribution }} JDK ${{ matrix.target }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.target }}
distribution: ${{ matrix.distribution }}

- name: Set up JDK 21 for Gradle
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: temurin

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-

- name: Build for JDK ${{ matrix.target }}
run: |
chmod +x gradlew
./gradlew --no-daemon clean build mletFile \
-PtargetJdk=${{ matrix.target }} \
-PmletUrl=http://127.0.0.1:8000

- name: Integration test on JDK ${{ matrix.target }}
shell: bash
env:
TARGET_JDK: ${{ matrix.target }}
SKIP_BUILD: '1'
run: |
var="JAVA_HOME_${TARGET_JDK}_X64"
target_home="${!var}"
if [ -z "$target_home" ]; then
echo "Could not resolve target JDK home for $var" >&2
exit 1
fi
"$target_home/bin/java" -version
chmod +x scripts/integration-test.sh
JAVA_HOME="$target_home" scripts/integration-test.sh "${TARGET_JDK}"

- name: Stage release contents
shell: bash
run: |
rm -rf staging
mkdir -p staging/web
cp build/libs/jmxshell-*.jar staging/
cp build/web/compromise.jar staging/web/
ls -la staging staging/web

- name: Upload jdk${{ matrix.target }} artifact
uses: actions/upload-artifact@v4
with:
name: jmxshell-jdk${{ matrix.target }}
path: staging/
retention-days: 7
if-no-files-found: error
90 changes: 90 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: release

on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

jobs:
build:
name: Build & integration-test ${{ matrix.distribution }} JDK ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: '8'
distribution: temurin
- target: '11'
distribution: temurin
- target: '17'
distribution: temurin
- target: '21'
distribution: oracle
steps:
- uses: actions/checkout@v4

- name: Set up target ${{ matrix.distribution }} JDK ${{ matrix.target }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.target }}
distribution: ${{ matrix.distribution }}

- name: Set up JDK 21 for Gradle
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: temurin

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-

- name: Build for JDK ${{ matrix.target }}
run: |
chmod +x gradlew
./gradlew --no-daemon clean build mletFile \
-PtargetJdk=${{ matrix.target }} \
-PmletUrl=http://127.0.0.1:8000

- name: Integration test on JDK ${{ matrix.target }}
shell: bash
env:
TARGET_JDK: ${{ matrix.target }}
SKIP_BUILD: '1'
run: |
var="JAVA_HOME_${TARGET_JDK}_X64"
target_home="${!var}"
if [ -z "$target_home" ]; then
echo "Could not resolve target JDK home for $var" >&2
exit 1
fi
"$target_home/bin/java" -version
chmod +x scripts/integration-test.sh
JAVA_HOME="$target_home" scripts/integration-test.sh "${TARGET_JDK}"

- name: Stage release contents
shell: bash
run: |
rm -rf staging
mkdir -p staging/web
cp build/libs/jmxshell-*.jar staging/
cp build/web/compromise.jar staging/web/
ls -la staging staging/web

- name: Upload jdk${{ matrix.target }} artifact
uses: actions/upload-artifact@v4
with:
name: jmxshell-jdk${{ matrix.target }}
path: staging/
retention-days: 30
if-no-files-found: error
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Gradle
.gradle/
build/
!gradle/wrapper/gradle-wrapper.jar

# IDE
.idea/
*.iml
.vscode/
.DS_Store
48 changes: 0 additions & 48 deletions CleanupMbean.java

This file was deleted.

30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

Loading
Loading