Skip to content

Switch hosting of devel packages from Google cloud to Github releases #8121

Switch hosting of devel packages from Google cloud to Github releases

Switch hosting of devel packages from Google cloud to Github releases #8121

Workflow file for this run

name: Documentation
on:
workflow_dispatch:
inputs:
developer_build:
description: 'Set to OFF for Release documentation'
required: false
default: 'ON'
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
headless-docs:
# Build headless and docs
runs-on: ubuntu-latest # Warn about build issues in new versions
env:
OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML
DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }}
steps:
- name: Checkout Open3D source code
uses: actions/checkout@v4
- name: Maximize build space
run: |
source util/ci_utils.sh
maximize_ubuntu_github_actions_build_space
- name: Checkout Open3D-ML source code
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
path: ${{ env.OPEN3D_ML_ROOT }}
- name: Setup cache
uses: actions/cache@v4
with:
# Ref: https://github.com/apache/incubator-mxnet/pull/18459/files
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
# only created if there is no existing entry for the key yet.
key: ${{ runner.os }}-ccache-${{ github.sha }}
# Restore any ccache cache entry, if none for
# ${{ runner.os }}-ccache-${{ github.sha }} exists.
# Common prefix will be used so that ccache can be used across commits.
restore-keys: |
${{ runner.os }}-ccache
- name: Set up Python version
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
# the build system of the main repo expects a main branch. make sure
# main exists
pushd "${OPEN3D_ML_ROOT}"
git checkout -b main || true
popd
source util/ci_utils.sh
install_docs_dependencies "${OPEN3D_ML_ROOT}"
- name: Build docs
run: |
PATH=/usr/lib/ccache:$PATH
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
ccache -s
source util/ci_utils.sh
build_docs "$DEVELOPER_BUILD"
ccache -s
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: open3d_docs
path: docs/_out/html
if-no-files-found: error
- name: Deploy docs # Compress and upload the docs, only for main branch
# if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
tar_file="${GITHUB_SHA}.tar.gz"
rm -rf ${tar_file}
# Docs in docs/_out/html
tar -C docs/_out -czvf ${tar_file} html
gh release upload main-devel ${tar_file} --clobber
gh release view main-devel
- name: Check release artifacts and ready documentation archive
# if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
this_sha=$(echo ${GITHUB_SHA} | cut -c 1-6)
last_shas=($(git log --pretty=format:%h --abbrev-commit -n 3))
echo "Waiting for all assets to be ready..."
n_this_sha_assets=$(gh release view main-devel --json assets --jq ".assets | map(select(.name | contains(\"${this_sha}\"))) | length")
while ((n_this_sha_assets < 3)); do
sleep 6
echo -n "."
n_this_sha_assets=$(gh release view main-devel --json assets --jq ".assets | map(select(.name | contains(\"${this_sha}\"))) | length")
done
echo "All assets ready. Removing release assets more than 3 commits old..."
release_assets=($(gh release view main-devel --json assets --jq '.assets[] | .name'))
for relass in "${release_assets[@]}"; do
found=false
for last_sha in "${last_shas[@]}"; do
if [[ $relass == *${last_sha}* ]]; then
found=true
fi
done
if [ $found == false ]; then
#set -x
gh release delete-asset main-devel $relass
#set +x
fi
done
gh release view main-devel