Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Upload Artifacts

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

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Build with Maven
run: mvn clean verify

- name: Upload all JAR artifacts (retention 30 days)
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ github.sha }}
path: "**/target/**.jar"
retention-days: 30
43 changes: 43 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PR Check

on:
pull_request:

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

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

# Manual Maven dependency cache with PR source branch as part of key for strict isolation
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
# Key components: runner OS, PR source branch, pom.xml hash
key: ${{ runner.os }}-m2-${{ github.event.pull_request.head.ref }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-${{ github.event.pull_request.head.ref }}-

- name: Build and run tests
run: mvn clean test

- name: Upload test reports (optional)
uses: actions/upload-artifact@v4
with:
name: test-reports
path: "**/target/surefire-reports/"
retention-days: 7
42 changes: 42 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tag Prerelease

on:
workflow_run:
workflows: ["Build and Upload Artifacts"]
types:
- completed

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success' &&
startsWith(github.event.workflow_run.head_branch, 'v')

steps:
- name: Download all artifacts from build workflow
uses: actions/download-artifact@v4
with:
name: build-artifacts-${{ github.event.workflow_run.head_sha }}
path: downloaded-artifacts

- name: List downloaded files (for debugging)
run: ls -R downloaded-artifacts

- name: Create GitHub Pre-release (filter out sources/javadoc)
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.workflow_run.head_branch }}
name: "Pre-release ${{ github.event.workflow_run.head_branch }}"
draft: false
prerelease: true
# Include all JARs, exclude sources and javadoc
files: |
downloaded-artifacts/**/*.jar
!downloaded-artifacts/**/*-sources.jar
!downloaded-artifacts/**/*-javadoc.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}