diff --git a/.github/workflows/Doxygen.yml b/.github/workflows/Doxygen.yml index 6590403b26..ea1b1fc3e4 100644 --- a/.github/workflows/Doxygen.yml +++ b/.github/workflows/Doxygen.yml @@ -9,21 +9,24 @@ on: jobs: doxygen: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Build Docker Image for Doxygen run: | docker build -f Dockerfile -t itk-doxygen . + - name: Docker Doxygen generation run: | docker run --name itk-dox itk-doxygen mkdir -p artifacts docker cp itk-dox:/ITKDoxygen.tar.gz artifacts/ITKDoxygen-${GITHUB_SHA}.tar.gz docker cp itk-dox:/ITKDoxygenXML.tar.gz artifacts/ITKDoxygenXML-${GITHUB_SHA}.tar.gz + - name: Archive Doxygen Artifacts uses: actions/upload-artifact@v4 with: @@ -31,6 +34,31 @@ jobs: path: | artifacts/ITKDoxygenXML-*.tar.gz artifacts/ITKDoxygen-*.tar.gz + + - name: Publish to latest GitHub Release + if: github.ref == 'refs/heads/main' + run: | + sudo apt install -y zstd + + pushd artifacts + + cp ITKDoxygen-*.tar.gz InsightDoxygenDocHtml-latest.tar.gz + gunzip InsightDoxygenDocHtml-latest.tar.gz + zstd -f -10 -T6 --long=31 InsightDoxygenDocHtml-latest.tar -o InsightDoxygenDocHtml-latest.tar.zst + gzip -9 InsightDoxygenDocHtml-latest.tar + + cp ITKDoxygenXML-*.tar.gz InsightDoxygenDocXml-latest.tar.gz + gunzip InsightDoxygenDocXml-latest.tar.gz + zstd -f -10 -T6 --long=31 InsightDoxygenDocXml-latest.tar -o InsightDoxygenDocXml-latest.tar.zst + gzip -9 InsightDoxygenDocXml-latest.tar + + popd + + gh release delete -R InsightSoftwareConsortium/ITKDoxygen --cleanup-tag latest --yes + gh release create latest --notes="ITK Doxygen documentation built from the ITK master branch." --prerelease --title "ITKDoxygen Latest" -R InsightSoftwareConsortium/ITKDoxygen ./artifacts/InsightDoxygen* + env: + GH_TOKEN: ${{ secrets.github_token }} + - name: Update gh-pages if: github.ref == 'refs/heads/main' run: | diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000000..3fbcb575dd --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,22 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version, and other tools you might need +build: + os: ubuntu-24.04 + tools: + python: "mambaforge-23.11" + + commands: + # Write down your commands here to: + # + # - Install the dependencies of your project + # - Build the documentation + # - Save the generated files in $READTHEDOCS_OUTPUT/html + - mamba remove --force --name rtd --all + - mamba env create -f rtd-environment.yml + - mamba run -n rtd zstd --version + - ./rtd-download.sh diff --git a/.rtd-publish-version b/.rtd-publish-version new file mode 100644 index 0000000000..5845e34402 --- /dev/null +++ b/.rtd-publish-version @@ -0,0 +1 @@ +v5.2.0 2025-01-16-11-44-1737045882 diff --git a/README.md b/README.md index 709eca36f1..a9d0dcd945 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ docker run \ The following commands will copy the tarballs from the Docker container to your local working directory. ```shell -docker cp itk-dox:/ITKDoxygen.tar.gz SimpleITKDoxygen${TAG:+-${TAG}}.tar.gz -docker cp itk-dox:/ITKDoxygenXML.tar.gz SimpleITKDoxygenXML${TAG:+-${TAG}}.tar.gz +docker cp itk-dox:/ITKDoxygen.tar.gz ITKDoxygen${TAG:+-${TAG}}.tar.gz +docker cp itk-dox:/ITKDoxygenXML.tar.gz ITKDoxygenXML${TAG:+-${TAG}}.tar.gz # Remove the Docker container after copying the tarballs docker rm itk-dox @@ -75,12 +75,12 @@ docker rm itk-dox ### 6. Extract the Doxygen Documentation Untar these tarballs to extract and verify the Doxygen documentation. -The `SimpleITKDoxygen` tarball contains the HTML documentation, -while the `SimpleITKDoxygenXML` tarball contains the XML documentation. +The `ITKDoxygen` tarball contains the HTML documentation, +while the `ITKDoxygenXML` tarball contains the XML documentation. ```shell -tar -xzf SimpleITKDoxygen${TAG:+-${TAG}}.tar.gz -tar -xzf SimpleITKDoxygenXML${TAG:+-${TAG}}.tar.gz +tar -xzf ITKDoxygen${TAG:+-${TAG}}.tar.gz +tar -xzf ITKDoxygenXML${TAG:+-${TAG}}.tar.gz ``` -You may now view the Doxygen documentation by opening the `html/index.html` file. \ No newline at end of file +You may now view the Doxygen documentation by opening the `html/index.html` file. diff --git a/rtd-download.sh b/rtd-download.sh new file mode 100755 index 0000000000..684c32c5dc --- /dev/null +++ b/rtd-download.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -eox + +DOC_VERSION=$(if [[ "${READTHEDOCS_GIT_IDENTIFIER}" == *v* ]]; then echo "${READTHEDOCS_GIT_IDENTIFIER}"; else echo "latest"; fi) +DOC_VERSION_NO_V=${DOC_VERSION//v/} +curl -LO https://github.com/InsightSoftwareConsortium/ITKDoxygen/releases/download/${DOC_VERSION}/InsightDoxygenDocHtml-${DOC_VERSION_NO_V}.tar.zst + +mkdir -p $READTHEDOCS_OUTPUT +unzstd --long=31 ./InsightDoxygenDocHtml-${DOC_VERSION_NO_V}.tar.zst +tar xf \ + ./InsightDoxygenDocHtml-${DOC_VERSION_NO_V}.tar \ + -C $READTHEDOCS_OUTPUT + diff --git a/rtd-environment.yml b/rtd-environment.yml new file mode 100644 index 0000000000..44136e8817 --- /dev/null +++ b/rtd-environment.yml @@ -0,0 +1,5 @@ +name: rtd +channels: + - conda-forge +dependencies: + - zstd