From 966645dd75d15dbf501847b0d78ec913527c07ef Mon Sep 17 00:00:00 2001 From: fl4nk3r-h Date: Sat, 11 Apr 2026 04:09:25 +0530 Subject: [PATCH 1/2] Add GitHub Actions Maven CI workflow --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4df3c47 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: Java CI + +on: + push: + branches: + - main + - ci/** + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + cache: maven + + - name: Build and test with Maven + run: mvn -B clean test From 325652efcb31085ff5c243b02685981343f0229e Mon Sep 17 00:00:00 2001 From: fl4nk3r-h Date: Sat, 11 Apr 2026 04:16:14 +0530 Subject: [PATCH 2/2] Add CI, dev prerelease, and main release workflows --- .github/workflows/ci.yml | 34 ++++++++++++--- .github/workflows/dev-prerelease.yml | 63 ++++++++++++++++++++++++++++ .github/workflows/main-release.yml | 61 +++++++++++++++++++++++++++ .gitignore | 3 ++ 4 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dev-prerelease.yml create mode 100644 .github/workflows/main-release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4df3c47..f19a835 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,10 @@ name: Java CI on: push: branches: - - main - - ci/** + - "**" pull_request: + branches: + - main jobs: build: @@ -15,12 +16,35 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: temurin - java-version: '17' + java-version: '21' cache: maven - name: Build and test with Maven - run: mvn -B clean test + run: mvn -B clean package + + - name: Resolve project metadata + id: meta + run: | + VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version) + ARTIFACT_ID=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.artifactId) + SHORT_SHA=${GITHUB_SHA::7} + VERSIONED_NAME="${ARTIFACT_ID}-${VERSION}-${GITHUB_RUN_NUMBER}-${SHORT_SHA}.jar" + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "artifact_id=${ARTIFACT_ID}" >> "$GITHUB_OUTPUT" + echo "versioned_name=${VERSIONED_NAME}" >> "$GITHUB_OUTPUT" + + - name: Prepare versioned JAR + run: | + mkdir -p dist + cp "target/${{ steps.meta.outputs.artifact_id }}-${{ steps.meta.outputs.version }}.jar" "dist/${{ steps.meta.outputs.versioned_name }}" + + - name: Upload versioned JAR artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.meta.outputs.versioned_name }} + path: dist/${{ steps.meta.outputs.versioned_name }} + if-no-files-found: error diff --git a/.github/workflows/dev-prerelease.yml b/.github/workflows/dev-prerelease.yml new file mode 100644 index 0000000..018e5d9 --- /dev/null +++ b/.github/workflows/dev-prerelease.yml @@ -0,0 +1,63 @@ +name: Dev Branch Prerelease + +on: + push: + branches: + - dev + - dev/** + +permissions: + contents: write + +jobs: + prerelease: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + cache: maven + + - name: Build and test with Maven + run: mvn -B clean package + + - name: Resolve artifact metadata + id: meta + run: | + VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version) + ARTIFACT_ID=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.artifactId) + BRANCH_NAME="${GITHUB_REF_NAME//\//-}" + SHORT_SHA=${GITHUB_SHA::7} + TAG_NAME="dev-${BRANCH_NAME}-${GITHUB_RUN_NUMBER}-${SHORT_SHA}" + JAR_NAME="${ARTIFACT_ID}-${VERSION}-${BRANCH_NAME}-${GITHUB_RUN_NUMBER}-${SHORT_SHA}.jar" + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "artifact_id=${ARTIFACT_ID}" >> "$GITHUB_OUTPUT" + echo "tag_name=${TAG_NAME}" >> "$GITHUB_OUTPUT" + echo "jar_name=${JAR_NAME}" >> "$GITHUB_OUTPUT" + + - name: Prepare versioned JAR + run: | + mkdir -p dist + cp "target/${{ steps.meta.outputs.artifact_id }}-${{ steps.meta.outputs.version }}.jar" "dist/${{ steps.meta.outputs.jar_name }}" + + - name: Upload prerelease artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.meta.outputs.jar_name }} + path: dist/${{ steps.meta.outputs.jar_name }} + if-no-files-found: error + + - name: Publish GitHub prerelease + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.meta.outputs.tag_name }} + name: Dev Prerelease ${{ steps.meta.outputs.tag_name }} + prerelease: true + generate_release_notes: true + files: dist/${{ steps.meta.outputs.jar_name }} diff --git a/.github/workflows/main-release.yml b/.github/workflows/main-release.yml new file mode 100644 index 0000000..785b2c5 --- /dev/null +++ b/.github/workflows/main-release.yml @@ -0,0 +1,61 @@ +name: Main Branch Release + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + cache: maven + + - name: Build and test with Maven + run: mvn -B clean package + + - name: Resolve artifact metadata + id: meta + run: | + VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version) + ARTIFACT_ID=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.artifactId) + SHORT_SHA=${GITHUB_SHA::7} + TAG_NAME="v${VERSION}-${GITHUB_RUN_NUMBER}-${SHORT_SHA}" + JAR_NAME="${ARTIFACT_ID}-${VERSION}-${GITHUB_RUN_NUMBER}-${SHORT_SHA}.jar" + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "artifact_id=${ARTIFACT_ID}" >> "$GITHUB_OUTPUT" + echo "tag_name=${TAG_NAME}" >> "$GITHUB_OUTPUT" + echo "jar_name=${JAR_NAME}" >> "$GITHUB_OUTPUT" + + - name: Prepare versioned JAR + run: | + mkdir -p dist + cp "target/${{ steps.meta.outputs.artifact_id }}-${{ steps.meta.outputs.version }}.jar" "dist/${{ steps.meta.outputs.jar_name }}" + + - name: Upload release artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.meta.outputs.jar_name }} + path: dist/${{ steps.meta.outputs.jar_name }} + if-no-files-found: error + + - name: Publish GitHub release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.meta.outputs.tag_name }} + name: Release ${{ steps.meta.outputs.tag_name }} + prerelease: false + generate_release_notes: true + files: dist/${{ steps.meta.outputs.jar_name }} diff --git a/.gitignore b/.gitignore index 8a84d6f..4129a7f 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,6 @@ TEST_SUMMARY.md *.so *.dll *.dylib + +# Local assistant context file +CLAUDE.md