Skip to content

Commit 31ccd6a

Browse files
committed
Add Maven Central deploy to CI, cleanup Gradle leftovers
1 parent f52dedd commit 31ccd6a

File tree

3 files changed

+69
-11
lines changed

3 files changed

+69
-11
lines changed

.github/workflows/main.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99

1010
name: Build Extension
1111

12-
on: [push, pull_request, workflow_dispatch]
12+
on:
13+
push:
14+
pull_request:
15+
workflow_dispatch:
16+
inputs:
17+
deploy:
18+
description: 'Deploy to Maven Central'
19+
type: boolean
20+
default: false
1321

1422
env:
1523
DAP_PORT: 10000
@@ -531,3 +539,40 @@ jobs:
531539
debuggee/logs/
532540
debuggee/lucee-server/context/logs/
533541
debuggee/lucee-server/context/cfclasses/
542+
543+
# Deploy to Maven Central (manual only, requires checkbox)
544+
deploy:
545+
name: Deploy to Maven Central
546+
runs-on: ubuntu-latest
547+
needs: [test-lucee-71, test-agent]
548+
if: github.event_name == 'workflow_dispatch' && inputs.deploy && github.ref == 'refs/heads/main'
549+
550+
steps:
551+
- name: Checkout
552+
uses: actions/checkout@v4
553+
554+
- name: Set up JDK 21
555+
uses: actions/setup-java@v4
556+
with:
557+
java-version: '21'
558+
distribution: 'temurin'
559+
server-id: ossrh
560+
server-username: MAVEN_USERNAME
561+
server-password: MAVEN_PASSWORD
562+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
563+
gpg-passphrase: GPG_PASSPHRASE
564+
565+
- name: Deploy extension to Maven Central
566+
run: mvn -B -e clean install -Dgoal=deploy
567+
env:
568+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
569+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
570+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
571+
572+
- name: Deploy agent to Maven Central
573+
working-directory: agent
574+
run: mvn -B -e clean deploy -DperformRelease=true --settings maven-settings.xml
575+
env:
576+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
577+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
578+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

AGENTS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ grep -E "ERROR|Exception|Failed" test-output/run-<RUN_ID>.log
7575

7676
Always use `test-output/` for workflow logs - it's gitignored so won't pollute the repo.
7777

78+
## Releasing to Maven Central
79+
80+
Versions are managed manually. Both artifacts must be updated before publishing:
81+
82+
- Extension version: `pom.xml``<version>` (root pom, drives the .lex and source/java JAR)
83+
- Agent version: `agent/pom.xml``<revision>` property
84+
85+
### Release steps
86+
87+
1. Update versions in both pom files (remove `-SNAPSHOT` suffix)
88+
2. Commit the version change
89+
3. Go to Actions → "Build Extension" → Run workflow
90+
4. Tick the **"Deploy to Maven Central"** checkbox
91+
5. Run — the deploy job runs after all tests pass
92+
6. After successful publish, bump versions to next `-SNAPSHOT` and commit
93+
94+
### Required GitHub secrets
95+
96+
- `MAVEN_USERNAME` - Sonatype OSSRH / Central Portal username
97+
- `MAVEN_PASSWORD` - Sonatype OSSRH / Central Portal password/token
98+
- `GPG_PRIVATE_KEY` - ASCII-armoured GPG private key for signing
99+
- `GPG_PASSPHRASE` - Passphrase for the GPG key
100+
78101
## Code Style
79102

80103
- Java 11+

extension/META-INF/MANIFEST.MF

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)