Skip to content

Release workflow: build numbers, manual releases and pre-releases, only finals to Maven Central - #12

Merged
GianTschingt merged 2 commits into
lucee:mainfrom
GianTschingt:release-workflow
Nov 18, 2026
Merged

GianTschingt merged 2 commits into
lucee:mainfrom
GianTschingt:release-workflow

Conversation

@GianTschingt

Copy link
Copy Markdown
Contributor

The release setup of the other extensions (MongoDB, HSQLDB, Image, Redis lucee/extension-redis#34) for the OSGi extension.

Changes to .github/workflows/main.yml (based on the Redis workflow):

  • Build numbers: the version is base.N[qualifier] (1.0.0.N-SNAPSHOT by default), N is the highest existing build + 1, read from the git tags, Maven Central, the Central snapshot repository and maven.lucee-services.com, for both org.lucee:osgi-extension and org.lucee:osgi. Builds of the same ref run one after another, so two merges never get the same number.
  • Manual run (workflow_dispatch): with deploy ticked it publishes the next build with the chosen qualifier: pom (the pom qualifier, -SNAPSHOT), SNAPSHOT, ALPHA, BETA, RC or release.
  • Only finals go to Maven Central. A final runs mvn deploy. SNAPSHOT, ALPHA, BETA and RC run a signed mvn install and are published to maven.lucee-services.com by the shared extension-s3-upload.yml (like the other extensions), never to Central.
  • GitHub releases: ALPHA, BETA and RC get a GitHub pre-release with the .lex files, a final a GitHub release, a SNAPSHOT none.
  • Deploy only for a push to main or a manual run, never for a pull request (before, the deploy job also ran for PRs). Runs without the deploy secrets (forks) only build and test and do not use up a build number.
  • Tests from forks: pull requests from forks do not get the repository variables, vars.LUCEE_TEST_VERSIONS_9 is then empty and the matrix fell over before the tests started. The matrix now falls back to a fixed 9.0 build (9.0.0.1487-ALPHA, branch 9.0).

Changes to the poms:

  • pom.xml: the version is ${revision} (extension.version.base 1.0.0, build 0, qualifier -SNAPSHOT), the flatten plugin resolves it in the installed/deployed pom (the S3 upload needs .flattened-pom.xml), and deploy.url is set (it was undefined, the deploy of the lite .lex used it) like in the other extensions.
  • source/java/pom.xml: ${revision} has a default, so the pom also resolves when it is built on its own. The root build still passes -Drevision with the version of the extension.
  • README.md: how versions and releases work.

Nothing has been published yet for org.lucee:osgi-extension (Central, Central snapshots and maven.lucee-services.com have no metadata), so the first push to main after this publishes 1.0.0.0-SNAPSHOT (or 1.0.0.1-SNAPSHOT if a tag exists by then).

Local check: mvn clean package -Dgoal=install builds osgi-extension-1.0.0.0-SNAPSHOT.lex, and with -Drevision=1.0.0.7-RC it builds osgi-extension-1.0.0.7-RC.lex with jars/osgi-1.0.0.7-RC.jar and version: "1.0.0.7-RC" in the manifest. No workflow run was started by hand.

The tests on this branch are the ones from #9, they fail on main until #10 and #11 are merged, and "is actually active" needs a core with lucee/Lucee#3816 (LDEV-6948). So the test job of this PR is expected to be red for those reasons.

@michaeloffner

Copy link
Copy Markdown
Contributor

Review of the release workflow (read the diff, did not run it).

Overall: the flow is clear and matches the other extensions: build number from tags and Maven metadata, only finals to Central, deploy only on a push to main or a manual run, tag after a successful publish. Findings:

  1. Nothing will be published until the tests are green. deploy needs test, and test fails on main today: "is actually active" needs Lucee 9 with LDEV-6948 set the lib folder for OSGi also for the startup config Lucee#3816 (merged this morning), but the newest build on maven.lucee-services.com is still 9.0.0.1487-ALPHA, and both LUCEE_TEST_VERSIONS_9 and the new fallback in the matrix point to it. After the next alpha is published, both have to be bumped (the variable and the fallback in the workflow), otherwise the first push to main after this PR builds but never publishes.
  2. A build number is consumed before the tests run. The number is resolved in build, the tag is created in deploy. A failing test run publishes nothing and creates no tag, so the number is reused by the next run. That is fine. But two refs can resolve the same number: the concurrency group contains the ref, the number space is global. A manual deploy from a branch and a push to main at the same time can both pick N. Use a fixed group for runs that deploy, for example group: osgi-extension-deploy when DO_DEPLOY is true.
  3. The published artifact is not the tested one. build builds the .lex with -Drevision, test tests it, deploy rebuilds from scratch (mvn clean install or deploy) and signs. Same commit, but the bytes are not guaranteed to be the same. The osgi-s3 artifact (used for S3 and the GitHub release) comes from the first build, Maven Central gets the second one. Either publish the tested files or document that they are rebuilt.
  4. Uploads are duplicated and the action versions are mixed: osgi-lex and osgi-s3 contain the same .lex files, one is upload-artifact@v7, the other @v4. One artifact (the S3 one) is enough for test as well.
  5. ${{ secrets.GPG_PASSPHRASE }} and ${{ secrets.MAVEN_USERNAME }} are expanded inside the shell script in "Resolve next revision". Pass them through env: and test [ -z "$GPG_PASSPHRASE" ], so a secret value can never become shell syntax.
  6. github-release: the find ... -name A -o -name B works, but only because -type f is repeated on both sides. Put it in parentheses. An ALPHA/BETA/RC is tagged twice (1.0.0.N by deploy and 1.0.0.N-RC by the release job), which is what the comment describes. Please make sure nobody lists tags with git tag -l "1.0.0.*" expecting only numbers (the build number lookup already filters with ^BASE\.([0-9]+)$).
  7. Pushed snapshots do not go to Central snapshots anymore (the old workflow ran mvn deploy for -SNAPSHOT). That matches the PR text, just note it in the release notes. The README says so.
  8. Fork pull requests use the fixed fallback 9.0.0.1487-ALPHA, which is fine, but see 1: that fallback will be red for fork PRs as well until it is bumped.

CI: build is green, the test job is red as the description says (needs a core with lucee/Lucee#3816). Not mergeable into a green main before 1 is solved.

@GianTschingt

Copy link
Copy Markdown
Contributor Author

I've addressed the review comments and rebased onto main.

  1. Left the 9.0 test version as 9.0.0.1487-ALPHA. A core with LDEV-6948 set the lib folder for OSGi also for the startup config Lucee#3816 is not published yet, so bumping it would not help. After the next alpha is out, both LUCEE_TEST_VERSIONS_9 and the fallback need to be updated.
  2. Runs that publish now share the osgi-extension-deploy concurrency group.
  3. S3 and GitHub Releases publish the tested .lex from the build job. Only a final is rebuilt, for the signed Maven Central deploy. Documented in the workflow and the README.
  4. One osgi-s3 artifact, uploaded with upload-artifact@v7 and downloaded with download-artifact@v8.
  5. GPG_PASSPHRASE and MAVEN_USERNAME are passed through env: and tested with [ -z ].
  6. The GitHub release find is parenthesized.
  7. No change (already documented; the README still says snapshots do not go to Central snapshots).
  8. Same as 1: the fork fallback stays on 9.0.0.1487-ALPHA until a newer alpha is published.

What's left: the test job will stay red until #11 is on main and a 9.0 core with #3816 is published and the test matrix is bumped. Not merged.

…ly finals to Maven Central

- the version is base.N[qualifier], N is the highest existing build + 1 (git tags,
  Maven Central, Central snapshots, maven.lucee-services.com), like the other
  extensions and Lucee core
- a manual run (workflow_dispatch) with deploy ticked publishes the next build
  as SNAPSHOT, ALPHA, BETA, RC or final release
- only a final goes to Maven Central, SNAPSHOT, ALPHA, BETA and RC go to
  maven.lucee-services.com only (shared extension-s3-upload workflow)
- ALPHA, BETA and RC get a GitHub pre-release, a final a GitHub release
- deploy only runs for a push to main or a manual run, never for a pull request
- deploy.url is set for the deploy of the lite .lex, ${revision} is resolved
  in the installed pom (flatten) and has a default in source/java/pom.xml
- the tests fall back to a fixed 9.0 build when LUCEE_TEST_VERSIONS_9 is not
  available (pull requests from forks)
- pass GPG_PASSPHRASE and MAVEN_USERNAME through env and test them with
  [ -z ], so a secret value never becomes shell syntax
- runs that publish share the osgi-extension-deploy concurrency group
- S3 and GitHub Releases publish the tested .lex from the build job;
  only a final is rebuilt, for the signed Maven Central deploy
- one osgi-s3 artifact, uploaded and downloaded with matching action
  versions
- parenthesize the GitHub release find
@GianTschingt
GianTschingt merged commit 19f3fa2 into lucee:main Nov 18, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants