Skip to content

Commit 316934e

Browse files
committed
WIP: RTD stub
1 parent c89aec0 commit 316934e

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

.github/workflows/Doxygen.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,56 @@ on:
99
jobs:
1010
doxygen:
1111

12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313

1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18+
1819
- name: Build Docker Image for Doxygen
1920
run: |
2021
docker build -f Dockerfile -t itk-doxygen .
22+
2123
- name: Docker Doxygen generation
2224
run: |
2325
docker run --name itk-dox itk-doxygen
2426
mkdir -p artifacts
2527
docker cp itk-dox:/ITKDoxygen.tar.gz artifacts/ITKDoxygen-${GITHUB_SHA}.tar.gz
2628
docker cp itk-dox:/ITKDoxygenXML.tar.gz artifacts/ITKDoxygenXML-${GITHUB_SHA}.tar.gz
29+
2730
- name: Archive Doxygen Artifacts
2831
uses: actions/upload-artifact@v4
2932
with:
3033
name: doxygen
3134
path: |
3235
artifacts/ITKDoxygenXML-*.tar.gz
3336
artifacts/ITKDoxygen-*.tar.gz
37+
38+
- name: Publish to latest GitHub Release
39+
if: github.ref == 'refs/heads/main'
40+
run: |
41+
sudo apt install -y zstd
42+
43+
pushd artifacts
44+
45+
cp ITKDoxygen-*.tar.gz InsightDoxygenDocHtml-latest.tar.gz
46+
gunzip InsightDoxygenDocHtml-latest.tar.gz
47+
zstd -f -10 -T6 --long=31 InsightDoxygenDocHtml-latest.tar -o InsightDoxygenDocHtml-latest.tar.zst
48+
gzip -9 InsightDoxygenDocHtml-latest.tar
49+
50+
cp ITKDoxygenXML-*.tar.gz InsightDoxygenDocXml-latest.tar.gz
51+
gunzip InsightDoxygenDocXml-latest.tar.gz
52+
zstd -f -10 -T6 --long=31 InsightDoxygenDocXml-latest.tar -o InsightDoxygenDocXml-latest.tar.zst
53+
gzip -9 InsightDoxygenDocXml-latest.tar
54+
55+
popd
56+
57+
gh release delete -R thewtex/ITKDoxygen --cleanup-tag latest --yes
58+
gh release create latest --notes="ITK Doxygen documentation built from the ITK master branch." --prerelease --title "ITKDoxygen Latest" -R thewtex/ITKDoxygen ./artifacts/InsightDoxygen*
59+
env:
60+
GH_TOKEN: ${{ secrets.github_token }}
61+
3462
- name: Update gh-pages
3563
if: github.ref == 'refs/heads/main'
3664
run: |

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "mambaforge-23.11"
12+
13+
commands:
14+
# Write down your commands here to:
15+
#
16+
# - Install the dependencies of your project
17+
# - Build the documentation
18+
# - Save the generated files in $READTHEDOCS_OUTPUT/html
19+
- mamba remove --force --name rtd --all
20+
- mamba env create -f rtd-environment.yml
21+
- mamba run -n rtd zstd --version
22+
- ./rtd-download.sh

rtd-download.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -eox
4+
5+
DOC_VERSION=$(if [[ "${READTHEDOCS_GIT_IDENTIFIER}" == *v* ]]; then echo "${READTHEDOCS_GIT_IDENTIFIER}"; else echo "latest"; fi)
6+
DOC_VERSION_NO_V=${DOC_VERSION//v/}
7+
curl -LO https://github.com/thewtex/ITKDoxygen/releases/download/${DOC_VERSION}/InsightDoxygenDocHtml-${DOC_VERSION_NO_V}.tar.zst
8+
9+
unzstd --long=31 ./InsightDoxygenDocHtml-${DOC_VERSION_NO_V}.tar.zst
10+
mkdir -p $READTHEDOCS_OUTPUT/html
11+
tar xf \
12+
./InsightDoxygenDocHtml-${DOC_VERSION_NO_V}.tar \
13+
--strip-components=1 \
14+
-C $READTHEDOCS_OUTPUT/html
15+

rtd-environment.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: rtd
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- zstd

0 commit comments

Comments
 (0)