Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/scripts/generate-versions-json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ if [[ ${#VERSIONS[@]} -eq 0 ]]; then
SORTED=()
else
IFS=$'\n'
SORTED=($(printf '%s\n' "${VERSIONS[@]}" | sed 's/^v//' | sort -t. -k1,1rn -k2,2rn -k3,3rn | sed 's/^/v/'))
SORTED=($(printf '%s\n' "${VERSIONS[@]}" | sort -rV))
unset IFS
fi

LATEST="${SORTED[0]:-}"
LATEST=""
if [[ ${#SORTED[@]} -gt 0 ]]; then
for v in "${SORTED[@]}"; do
if [[ ! "$v" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+ ]]; then
LATEST="$v"
break
fi
done
fi

HAS_MAIN=false
if [ -d "$GH_PAGES_DIR/main-branch" ]; then
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ jobs:
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

git fetch origin gh-pages
git worktree add /tmp/gh-pages gh-pages
if git ls-remote --exit-code --heads origin gh-pages >/dev/null 2>&1; then
git fetch origin gh-pages
git worktree add /tmp/gh-pages gh-pages
else
git worktree add --orphan -b gh-pages /tmp/gh-pages
fi

# Copy new docs into the version subdirectory
mkdir -p /tmp/gh-pages/${{ steps.target.outputs.destination }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
run: |
VERSION=$(git tag -l 'lldap-operator@v*' \
| sed 's/lldap-operator@//' \
| sort -t. -k1,1rn -k2,2rn -k3,3rn \
| sort -rV \
| head -1)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Detected version: $VERSION"
Expand Down
Loading