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
96 changes: 88 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: [setup, build-and-test]
# deploy only from pushes to the default branch, never for pull requests
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build-and-test.result == 'success'
# deploy only from pushes (or manual runs) on the default branch after the tests passed, never for pull requests or other branches
if: needs.build-and-test.result == 'success' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -175,19 +175,99 @@ jobs:
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Install Maven 3.9.16
# ubuntu-latest moved to Maven 3.10.0 (Oct 2026), which stages maven-metadata-local.xml
# in the deploy bundle; Central then rejects it
# ("Bundle has content that does NOT have a .pom file"). Pin 3.9.16 for the deploy.
run: |
curl -fsSL -o /tmp/maven.tar.gz https://archive.apache.org/dist/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz
echo "831a8591fe20c8243b1dbe7d71e3244f31d1665b0804b2e825e38cbbe5ce0cafb8338851f90780735568773e0a6cd07bbec107cda0b896b008b861075358b6f6 /tmp/maven.tar.gz" | sha512sum -c -
tar -xzf /tmp/maven.tar.gz -C /tmp
echo "/tmp/apache-maven-3.9.16/bin" >> "$GITHUB_PATH"
/tmp/apache-maven-3.9.16/bin/mvn -v

- name: Build and Deploy with Maven
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
VERSION: ${{ needs.setup.outputs.version }}
run: |
if [[ "${{ needs.setup.outputs.version }}" == *-SNAPSHOT ]]; then
echo "------- Maven Deploy snapshot on ${{ github.event_name }} -------";
if [ -z "$VERSION" ]; then
echo "::error::no version from the setup job"; exit 1
fi
if [[ "$VERSION" == *-SNAPSHOT ]]; then
echo "------- Maven Deploy snapshot $VERSION -------"
mvn -B -e -f pom.xml clean deploy -Dgoal=deploy --settings maven-settings.xml
elif [[ "${{ needs.setup.outputs.version }}" == *-ALPHA ]]; then
echo "------- Maven Install alpha on ${{ github.event_name }} -------";
elif [[ "$VERSION" == *-ALPHA ]]; then
echo "------- Maven Install alpha $VERSION (ALPHA builds are not published) -------"
mvn -B -e -f pom.xml clean install -Dgoal=install --settings maven-settings.xml
else
echo "------- Maven Deploy release on ${{ github.event_name }} -------";
# final, BETA and RC builds go to Maven Central
echo "------- Maven Deploy release $VERSION -------"
mvn -B -e -f pom.xml clean deploy -Dgoal=deploy -DperformRelease=true --settings maven-settings.xml
fi
fi

# LDEV-6677: the published .lex files (full and lite) for the github-release job
- name: Upload artifact for GitHub release
uses: actions/upload-artifact@v4
with:
name: http-release
path: target/*.lex

# LDEV-6677: publish every final, BETA and RC build as a GitHub release with its .lex files attached,
# like the other extensions (LDEV-6511). -SNAPSHOT and ALPHA builds are not published, so they get no GitHub release.
# Separate job, so a failure here never blocks the Maven Central deploy.
github-release:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [setup, deploy]
if: >-
needs.deploy.result == 'success'
&& (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
&& github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
&& !endsWith(needs.setup.outputs.version, '-SNAPSHOT')
&& !endsWith(needs.setup.outputs.version, '-ALPHA')
permissions:
# create the release (and its tag) and upload its assets
contents: write
steps:
# the files the deploy job built and published
- name: Download published extension
uses: actions/download-artifact@v4
with:
name: http-release
path: release-files

- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
VERSION: ${{ needs.setup.outputs.version }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
mapfile -t FILES < <(find release-files -type f \( -name "*-${VERSION}.lex" -o -name "*-${VERSION}.lite.lex" \) | sort)
if [ "${#FILES[@]}" -eq 0 ]; then
echo "::error::no .lex files for $VERSION found"; find release-files -type f; exit 1
fi
printf 'Asset: %s\n' "${FILES[@]}"

# the release tag is the exact published version (e.g. 1.0.0.0-BETA), created on this commit
# if it does not exist yet. BETA/RC are pre-releases and never "latest".
if [[ "$VERSION" == *-* ]]; then
PRE=(--prerelease --latest=false)
else
PRE=(--latest)
fi

if gh release view "$VERSION" >/dev/null 2>&1; then
echo "Release $VERSION already exists - uploading assets again"
gh release upload "$VERSION" "${FILES[@]}" --clobber
else
echo "Creating release $VERSION ${PRE[*]} on $GITHUB_SHA"
gh release create "$VERSION" "${FILES[@]}" "${PRE[@]}" --target "$GITHUB_SHA" \
--title "$VERSION" \
--notes "Build $VERSION from commit $GITHUB_SHA, published by $RUN_URL"
fi
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.0.0-BETA

- [LDEV-6677](https://luceeserver.atlassian.net/browse/LDEV-6677) — first BETA, published to Maven Central and as a GitHub pre-release with the .lex files, tested with the Lucee 9 versions from `LUCEE_TEST_VERSIONS_9`

## 1.0.0.0-ALPHA

- [LDEV-6677](https://luceeserver.atlassian.net/browse/LDEV-6677) — initial version, the HTTP engine based on Apache HttpClient 5, registered with the manifest attribute `http-engine`
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.lucee</groupId>
<artifactId>http-extension</artifactId>
<version>1.0.0.0-ALPHA</version>
<version>1.0.0.0-BETA</version>
<packaging>pom</packaging>
<name>HTTP</name>

Expand Down
Loading