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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 5 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
version: 2,
version: 2
updates:
- package-ecosystem: "gradle"
- package-ecosystem: maven
directory: "/"
schedule:
interval: "weekly"
day: "friday"
assignees:
- "jackmatt2"
labels:
- "dependencies"
interval: daily
time: "21:00"
open-pull-requests-limit: 10
64 changes: 0 additions & 64 deletions .github/workflows/build.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/codeql.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Dependabot auto-merge

on:
pull_request:
types:
- opened
- reopened
- synchronize

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Check if PR is mergeable
run: |
MERGEABLE=$(gh pr view "$PR_URL" --json mergeable -q .mergeable)
echo "Mergeable: $MERGEABLE"
if [ "$MERGEABLE" != "MERGEABLE" ]; then
echo "PR not mergeable. Skipping auto-merge."
exit 0
fi
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish to Maven Central

on:
release:
types: [published]

jobs:
publish:
name: Publish Maven package
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
server-id: central
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

# Set reproducible build timestamp
- name: Set build timestamp
run: |
# Use the commit timestamp for reproducibility
COMMIT_TIMESTAMP=$(git log -1 --format=%ct)
BUILD_TIMESTAMP=$(date -u -d @${COMMIT_TIMESTAMP} +"%Y-%m-%dT%H:%M:%SZ")
echo "BUILD_TIMESTAMP=$BUILD_TIMESTAMP" >> $GITHUB_ENV
echo "Setting build timestamp to: $BUILD_TIMESTAMP"
- name: Build and Test
run: mvn clean verify --batch-mode -Dproject.build.outputTimestamp="${BUILD_TIMESTAMP}"

- name: Determine version from tag
id: version
run: |
RAW_TAG="${GITHUB_REF##*/}"
VERSION="${RAW_TAG#v}"
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
VERSION="${VERSION}-SNAPSHOT"
fi
echo "Resolved version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set Maven version
run: mvn versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false

- name: Publish to Maven Central
run: mvn deploy --batch-mode -Dproject.build.outputTimestamp="${BUILD_TIMESTAMP}"
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
58 changes: 0 additions & 58 deletions .github/workflows/release.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Verify

on:
pull_request:
branches:
- '**'
jobs:
build:
name: Verify
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
server-id: central
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Execute the verify step
run: mvn -B verify
Loading