Skip to content

doc: fix binary name in README #1

doc: fix binary name in README

doc: fix binary name in README #1

Workflow file for this run

name: Site
on:
push:
branches: [main]
tags: ['v*']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions: {}
jobs:
deploy-site:
name: Build and publish Maven site
runs-on: ubuntu-latest
# Run on main (SNAPSHOT site) and version tags (release site) only
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
timeout-minutes: 30
permissions:
contents: write # to maintain the gh-pages storage branch
pages: write # to deploy to GitHub Pages
id-token: write # OIDC token required by actions/deploy-pages
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
disable-sudo-and-containers: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
release-assets.githubusercontent.com:443
repo.maven.apache.org:443
www.eclipse.org:443
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: '21'
- name: Set up uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
# Disable caching in this publish/deploy workflow to avoid cache-poisoning risk.
enable-cache: false
- name: Build Maven site, API Javadoc, and CLI man page
run: |
./mvnw -B -ntp -DskipTests -pl maven-plugin --also-make package site
./mvnw -B -ntp -DskipTests -pl api javadoc:javadoc
./mvnw -B -ntp -DskipTests -pl cli --also-make package
# Check out the accumulated gh-pages content so we can overlay new files
# and re-deploy the full site (native Pages has no keep_files equivalent).
# continue-on-error handles the first run when the branch doesn't exist yet.
- name: Checkout gh-pages storage branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
path: target/gh-pages-store
persist-credentials: false
continue-on-error: true
- name: Initialize gh-pages store if branch does not exist yet
run: |
if [ ! -d target/gh-pages-store/.git ]; then
git init target/gh-pages-store
git -C target/gh-pages-store checkout -b gh-pages
fi
- name: Update snapshot content
if: github.ref == 'refs/heads/main'
run: |
rm -rf target/gh-pages-store/snapshot
mkdir -p target/gh-pages-store/snapshot/maven-plugin target/gh-pages-store/snapshot/api-javadoc \
target/gh-pages-store/snapshot/cli-manpage
cp -r maven-plugin/target/site/. target/gh-pages-store/snapshot/maven-plugin/
cp -r api/target/reports/apidocs/. target/gh-pages-store/snapshot/api-javadoc/
cp -r cli/target/generated-docs/. target/gh-pages-store/snapshot/cli-manpage/
./mvnw -q -DforceStdout help:evaluate -Dexpression=project.version \
> target/gh-pages-store/snapshot/.version
- name: Update release content
if: startsWith(github.ref, 'refs/tags/v')
run: |
version="${GITHUB_REF_NAME#v}"
rm -rf "target/gh-pages-store/${version}" target/gh-pages-store/latest
mkdir -p "target/gh-pages-store/${version}/maven-plugin" "target/gh-pages-store/${version}/api-javadoc" \
"target/gh-pages-store/${version}/cli-manpage" \
target/gh-pages-store/latest/maven-plugin target/gh-pages-store/latest/api-javadoc \
target/gh-pages-store/latest/cli-manpage
cp -r maven-plugin/target/site/. "target/gh-pages-store/${version}/maven-plugin/"
cp -r maven-plugin/target/site/. target/gh-pages-store/latest/maven-plugin/
cp -r api/target/reports/apidocs/. "target/gh-pages-store/${version}/api-javadoc/"
cp -r api/target/reports/apidocs/. target/gh-pages-store/latest/api-javadoc/
cp -r cli/target/generated-docs/. "target/gh-pages-store/${version}/cli-manpage/"
cp -r cli/target/generated-docs/. target/gh-pages-store/latest/cli-manpage/
echo "$version" > "target/gh-pages-store/${version}/.version"
echo "$version" > target/gh-pages-store/latest/.version
- name: Generate root index page
run: uv run --project .github/tools --group python-common python3 .github/scripts/generate-site-index.py
- name: Configure Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: target/gh-pages-store
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
# Push the updated tree back so the next run can check it out.
- name: Commit and push gh-pages storage branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd target/gh-pages-store
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update site for ${GITHUB_REF_NAME}"
git remote set-url origin "https://github.com/${GITHUB_REPOSITORY}.git" 2>/dev/null \
|| git remote add origin "https://github.com/${GITHUB_REPOSITORY}.git"
auth_header=$(printf "x-access-token:%s" "${GITHUB_TOKEN}" | base64)
git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" push origin gh-pages
fi