From 91800cc569300c0d4b58b46267856127d03e77da Mon Sep 17 00:00:00 2001 From: Gian Tschingt <336450015+GianTschingt@users.noreply.github.com> Date: Fri, 23 Oct 2026 07:10:20 +0200 Subject: [PATCH] LDEV-6677 1.0.0.0-BETA, publish BETA builds to Maven Central and as GitHub pre-release from the default branch after the tests, Lucee test versions only from LUCEE_TEST_VERSIONS_9, pin Maven 3.9.16 for the Central deploy --- .github/workflows/main.yml | 96 ++++++++++++++++++++++++++++++++++---- CHANGELOG.md | 4 ++ pom.xml | 2 +- 3 files changed, 93 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aacfea8..59996ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 \ No newline at end of file + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6735475..574fee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/pom.xml b/pom.xml index 243e494..62cb0bc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.lucee http-extension - 1.0.0.0-ALPHA + 1.0.0.0-BETA pom HTTP