Skip to content

Commit

Permalink
devel release on main only
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed May 6, 2024
1 parent 43d3a83 commit 6d60d7d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 50 deletions.
70 changes: 33 additions & 37 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,48 +84,44 @@ jobs:
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' }}
- name: Deploy docs if all artifacts available
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
tar_file="${GITHUB_SHA}.tar.gz"
tar_file="open3d-${GITHUB_SHA}-docs.tar.gz"
rm -rf ${tar_file}
# Docs in docs/_out/html
tar -C docs/_out -czvf ${tar_file} html
tar -C docs/_out -czf ${tar_file} html
echo "Waiting for other release assets..."
this_sha=$(echo ${GITHUB_SHA} | cut -c 1-6)
n_this_sha_assets=$(gh release view main-devel --json assets --jq ".assets | map(select(.name | contains(\"${this_sha}\"))) | length")
# Total assets from each main branch commmit:
# Python wheels (4x4) + Viewer (3) + C++ libs (4+2+2) = 27,
while ((n_this_sha_assets < 27)); do
sleep 60
echo -n "."
n_this_sha_assets=$(gh release view main-devel --json assets --jq ".assets | map(select(.name | contains(\"${this_sha}\"))) | length")
done
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")
# Total assets from each main branch commmit:
# Docs (1) + Python wheels (4x4) + Viewer (3) + C++ libs (4+2+2) = 28,
while ((n_this_sha_assets < 16)); do
sleep 60
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
echo "\nAll assets ready. Removing release assets except from last 3 commits: ${last_shas[@]}"
release_assets=($(gh release view main-devel --json assets --jq '.assets[] | .name'))
last_shas=($(git log --pretty=format:%h --abbrev-commit -n 3))
echo "Waiting for all assets to be ready..."
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
5 changes: 2 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ jobs:
if-no-files-found: error

- name: Update package devel release
# if: ${{ github.ref == 'refs/heads/main' && env.BUILD_SHARED_LIBS == 'ON' }}
if: ${{ env.BUILD_SHARED_LIBS == 'ON' }}
if: ${{ github.ref == 'refs/heads/main' && env.BUILD_SHARED_LIBS == 'ON' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down Expand Up @@ -345,7 +344,7 @@ jobs:
if-no-files-found: error

- name: Update devel release
# if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ubuntu-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ jobs:
if-no-files-found: error

- name: Update devel release
#if: ${{ github.ref == 'refs/heads/main' && env.BUILD_PACKAGE == 'true' }}
if: ${{ env.BUILD_PACKAGE == 'true' }}
if: ${{ github.ref == 'refs/heads/main' && env.BUILD_PACKAGE == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ jobs:
path: open3d-viewer-*-Linux.deb
if-no-files-found: error
- name: Update devel release
# if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload main-devel open3d-devel-*.tar.xz --clobber || true
gh release upload main-devel open3d-viewer-*-Linux.deb --clobber || true
if [ ${BUILD_SHARED_LIBS} == 'ON' ] ; then
gh release upload main-devel open3d-devel-*.tar.xz --clobber
else
gh release upload main-devel open3d-viewer-*-Linux.deb --clobber
fi
gh release view main-devel
8 changes: 3 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ jobs:
if-no-files-found: error

- name: Update devel release with package
# if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' }}
if: ${{ matrix.BUILD_SHARED_LIBS == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' }}
if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand All @@ -181,8 +180,7 @@ jobs:
if-no-files-found: error

- name: Update devel release with viewer
# if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' && matrix.CONFIG == 'Release' }}
if: ${{ matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' && matrix.CONFIG == 'Release' }}
if: ${{ github.ref == 'refs/heads/main' && matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' && matrix.BUILD_CUDA_MODULE == 'OFF' && matrix.CONFIG == 'Release' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand Down Expand Up @@ -310,7 +308,7 @@ jobs:
if-no-files-found: error

- name: Update devel release with wheel
# if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand Down

0 comments on commit 6d60d7d

Please sign in to comment.