Skip to content

Commit 2e0776a

Browse files
authored
fix(docs): Fix docs build during releases (AztecProtocol#3815)
Fixes the issue introduced in AztecProtocol#3762, which caused the docs build step to always attempt to fetch the last released version. Due to how release-plase works, the last released version during a release is the version being released, which is not available as a tag to be fetched. To avoid this issue, we first check if the tag to be checked out is available, and if not, just load the code snippets from master.
1 parent 022a918 commit 2e0776a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.circleci/config.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -892,11 +892,14 @@ jobs:
892892
- run:
893893
name: "Require released code"
894894
command: |
895-
echo Requiring released code snippets
896-
echo "INCLUDE_RELEASED_CODE=1" >> docs/.env
897895
LAST_TAG="aztec-packages-v$(jq -r '.["."]' .release-please-manifest.json)"
898-
echo Fetching latest released tag $LAST_TAG
899-
git fetch origin --refetch --no-filter refs/tags/$LAST_TAG:refs/tags/$LAST_TAG
896+
if git ls-remote --tags origin | grep "$LAST_TAG" > /dev/null; then
897+
echo "Using code released from $LAST_TAG"
898+
echo "INCLUDE_RELEASED_CODE=1" >> docs/.env
899+
git fetch origin --refetch --no-filter refs/tags/$LAST_TAG:refs/tags/$LAST_TAG
900+
else
901+
echo "Skipping as $LAST_TAG is not yet published"
902+
fi
900903
- run:
901904
name: "Build docs"
902905
command: build docs

0 commit comments

Comments
 (0)