GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — Add a manually-triggered site publishing workflow by slachiewicz · Pull Request #62 · codehaus-plexus/.github Conversation
Member
Part of #58. The last item on the plan. Site publishing is entirely manual today and was documented differently in six READMEs, two of which contradicted their own POM. That shows up in the Deliberately
|
| Goals | content |
|
|---|---|---|
| single-module (10 repos) | site-deploy |
target/site, set in each POM |
| multi-module (4 repos) | site site:stage scm-publish:publish-scm |
target/staging — the plugin default |
I checked the plugin descriptor rather than assuming: content defaults to ${project.build.directory}/staging, which is exactly what site:stage produces. So the multi-module input switches goals and needs no other configuration.
Property names are from the plugin descriptor too — scmpublish.pubScmUrl, scmpublish.scm.branch, scmpublish.content, scmpublish.dryRun.
dry-runBuilds the site and checks out gh-pages without committing or pushing. The first use of this in any repository should be a dry run.
cancel-in-progress: false, grouped per repository. Two concurrent runs would race on gh-pages, and cancelling one mid-push is worse than queueing.
Once this merges, each repository needs a small caller. I'll do two first so the shape can be reviewed before the sweep:
name: Publish Site on: workflow_dispatch: jobs: site: uses: codehaus-plexus/.github/.github/workflows/site.yml@master
and for the multi-module ones:
with: multi-module: true
That is modello, plexus-compiler, plexus-languages and plexus-interactivity.
Note this cannot be end-to-end tested until it is on master, since workflow_call resolves against a ref — which is the other reason for the dry-run input.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Site publishing is currently entirely manual and undocumented per repository, which is why gh-pages branches range from May 2023 to June 2026. This gives every project one button instead. Deliberately workflow_dispatch rather than release-triggered: it puts no unreviewed content live, and Maven site builds break often enough that a person should see the output. Handles both layouts. Single-module projects bind scm-publish to site-deploy and set content to target/site; multi-module projects need site:stage first, and the plugin's default content is target/staging, so the multi-module input switches goals and nothing else. The POMs derive pubScmUrl from scm.developerConnection, which is an ssh URL that cannot authenticate in Actions. The workflow overrides it to https and supplies the credential through a git insteadOf rule, so the job token stays out of the command line and the process list. A dry-run input builds the site and checks out gh-pages without committing, so the first use in a repository can be verified safely.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Introduces a reusable GitHub Actions workflow intended to provide a single, manually triggered (“one button”) procedure for generating and publishing Maven project sites to the gh-pages branch across repositories in the codehaus-plexus org.
Changes:
workflow_call workflow to build and publish Maven sites.dry-run mode.gh-pages using the job token..github/workflows/site.yml:90
maven-version) via dot notation. Use bracket notation (inputs['maven-version']) to avoid the expression being parsed as subtraction and failing at runtime. run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"
.github/workflows/site.yml:109
multi-module, dry-run) are accessed with dot notation here, which GitHub Actions will parse as arithmetic (e.g. inputs.multi-module). Use bracket notation for these input names so the conditional goals selection and dry-run flag work. ./mvnw ${{ inputs.maven_args }} \
${{ inputs.multi-module && 'site site:stage scm-publish:publish-scm' || 'site-deploy' }} \
"-Dscmpublish.pubScmUrl=scm:git:https://github.com/${{ github.repository }}.git" \
"-Dscmpublish.scm.branch=gh-pages" \
"-Dscmpublish.dryRun=${{ inputs.dry-run }}" \
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks — I checked this one rather than applying it, and I believe the review is mistaken. No change made; here is the evidence. The claim: hyphenated input names cannot be read with dot notation, because This organisation's existing shared workflows already do exactly that, and have been running across every repository here for a long time:
GitHub's own reusable-workflow documentation uses the same form in its worked example ( So dot notation on hyphenated inputs is fine, and switching to bracket notation would make this workflow inconsistent with the two shared workflows beside it for no benefit. Two things worth saying about the risk, since I would rather not be quietly wrong here:
Happy to be shown otherwise if someone has a counter-example. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
plexus-sec-dispatcher now has the scm-publish binding every other single-module project uses, so the documented command works there too. Removes the 'Known gap' section. Replaces 'why this isn't automated' with how to use the Publish Site workflow, and keeps the reasoning for why it is triggered by hand rather than on release. Follow-up to codehaus-plexus/plexus-sec-dispatcher#133 and #62.
Calls the shared workflow from codehaus-plexus/.github#62, so the organisation site can be published from the Actions tab rather than by a maintainer running 'mvn site-deploy' locally. This site is served from the master branch, not gh-pages, because it is an organisation page. That target comes from scmBranch in this POM; the shared workflow leaves the branch to the POM rather than forcing gh-pages, which is codehaus-plexus/.github#65. Part of codehaus-plexus/.github#58
Calls the shared workflow added in codehaus-plexus/.github#62, so the site can be published from the Actions tab instead of from a maintainer's laptop. Single-module project, so no multi-module input: the POM binds scm-publish to site-deploy already. Exposes dry-run so the first publish here can be verified without committing to gh-pages. Part of codehaus-plexus/.github#58
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.