@@ -7,67 +7,67 @@ permissions:
77 contents : write
88 packages : write
99jobs :
10- # check-docs-version:
11- # name: Check Documentation Version
12- # if: github.repository_owner == 'NethermindEth'
13- # runs-on: ubuntu-latest
14- # steps:
15- # - name: Checkout code
16- # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17- # - name: Verify docs are versioned for this release
18- # run: |
19- # TAG="${GITHUB_REF#refs/tags/v}"
20- # echo "Release version: ${TAG}"
21- #
22- # # Skip pre-release tags (rc, beta, alpha)
23- # if [[ "$TAG" =~ [.\-](rc|beta|alpha) ]]; then
24- # echo "::notice::Skipping docs version check for pre-release: v${TAG}"
25- # exit 0
26- # fi
27- #
28- # # Extract the minor version (X.Y.0) from the tag
29- # MAJOR=$(echo "$TAG" | cut -d. -f1)
30- # MINOR=$(echo "$TAG" | cut -d. -f2)
31- # MINOR_VERSION="${MAJOR}.${MINOR}.0"
32- # echo "Expected docs version: ${MINOR_VERSION}"
33- #
34- # # 1. Check versions.json contains the minor version
35- # if ! grep -q "\"${MINOR_VERSION}\"" docs/versions.json; then
36- # echo "::error::Documentation version ${MINOR_VERSION} is NOT in docs/versions.json"
37- # echo ""
38- # echo "Before releasing, version the docs:"
39- # echo " cd docs && npm run docusaurus docs:version ${MINOR_VERSION}"
40- # echo " git add docs/ && git commit -m 'docs: version ${MINOR_VERSION}'"
41- # echo " git push origin main"
42- # echo ""
43- # exit 1
44- # fi
45- #
46- # # 2. Verify the versioned docs directory exists
47- # VERSIONED_DIR="docs/versioned_docs/version-${MINOR_VERSION}"
48- # if [ ! -d "${VERSIONED_DIR}" ]; then
49- # echo "::error::${VERSIONED_DIR}/ directory is missing"
50- # exit 1
51- # fi
52- #
53- # # 3. Check for drift between current docs and versioned docs
54- # DIFF_OUTPUT=$(diff -r docs/docs/ "${VERSIONED_DIR}/" 2>&1) || true
55- # if [ -n "$DIFF_OUTPUT" ]; then
56- # echo "::error::Versioned docs (${VERSIONED_DIR}) are out of sync with docs/docs/"
57- # echo ""
58- # echo "The following files differ:"
59- # echo "$DIFF_OUTPUT"
60- # echo ""
61- # echo "Re-version the docs to pick up the latest changes:"
62- # echo " cd docs && rm -rf versioned_docs/version-${MINOR_VERSION} versioned_sidebars/version-${MINOR_VERSION}-sidebars.json"
63- # echo " npm run docusaurus docs:version ${MINOR_VERSION}"
64- # echo " git add docs/ && git commit -m 'docs: re-version ${MINOR_VERSION}'"
65- # echo " git push origin main"
66- # echo ""
67- # exit 1
68- # fi
69- #
70- # echo "Documentation version ${MINOR_VERSION} is present and up to date."
10+ check-docs-version :
11+ name : Check Documentation Version
12+ if : github.repository_owner == 'NethermindEth'
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+ - name : Verify docs are versioned for this release
18+ run : |
19+ TAG="${GITHUB_REF#refs/tags/v}"
20+ echo "Release version: ${TAG}"
21+
22+ # Skip pre-release tags (rc, beta, alpha)
23+ if [[ "$TAG" =~ [.\-](rc|beta|alpha) ]]; then
24+ echo "::notice::Skipping docs version check for pre-release: v${TAG}"
25+ exit 0
26+ fi
27+
28+ # Extract the minor version (X.Y.0) from the tag
29+ MAJOR=$(echo "$TAG" | cut -d. -f1)
30+ MINOR=$(echo "$TAG" | cut -d. -f2)
31+ MINOR_VERSION="${MAJOR}.${MINOR}.0"
32+ echo "Expected docs version: ${MINOR_VERSION}"
33+
34+ # 1. Check versions.json contains the minor version
35+ if ! grep -q "\"${MINOR_VERSION}\"" docs/versions.json; then
36+ echo "::error::Documentation version ${MINOR_VERSION} is NOT in docs/versions.json"
37+ echo ""
38+ echo "Before releasing, version the docs:"
39+ echo " cd docs && npm run docusaurus docs:version ${MINOR_VERSION}"
40+ echo " git add docs/ && git commit -m 'docs: version ${MINOR_VERSION}'"
41+ echo " git push origin main"
42+ echo ""
43+ # exit 0
44+ fi
45+
46+ # 2. Verify the versioned docs directory exists
47+ VERSIONED_DIR="docs/versioned_docs/version-${MINOR_VERSION}"
48+ if [ ! -d "${VERSIONED_DIR}" ]; then
49+ echo "::error::${VERSIONED_DIR}/ directory is missing"
50+ # exit 0
51+ fi
52+
53+ # 3. Check for drift between current docs and versioned docs
54+ DIFF_OUTPUT=$(diff -r docs/docs/ "${VERSIONED_DIR}/" 2>&1) || true
55+ if [ -n "$DIFF_OUTPUT" ]; then
56+ echo "::error::Versioned docs (${VERSIONED_DIR}) are out of sync with docs/docs/"
57+ echo ""
58+ echo "The following files differ:"
59+ echo "$DIFF_OUTPUT"
60+ echo ""
61+ echo "Re-version the docs to pick up the latest changes:"
62+ echo " cd docs && rm -rf versioned_docs/version-${MINOR_VERSION} versioned_sidebars/version-${MINOR_VERSION}-sidebars.json"
63+ echo " npm run docusaurus docs:version ${MINOR_VERSION}"
64+ echo " git add docs/ && git commit -m 'docs: re-version ${MINOR_VERSION}'"
65+ echo " git push origin main"
66+ echo ""
67+ # exit 1
68+ fi
69+
70+ echo "Documentation version ${MINOR_VERSION} is present and up to date."
7171 build-binaries :
7272 name : Build Binaries
7373 if : github.repository_owner == 'NethermindEth'
0 commit comments