Skip to content
Merged

Next #105

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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"rules": {
"@typescript-eslint/no-unused-vars": "error"
},
"ignorePatterns": ["node_modules/*", "dist/*", "coverage/*"]
"ignorePatterns": ["node_modules/*", "dist/*", "coverage/*", "docusaurus/*"]
}
55 changes: 20 additions & 35 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,71 +16,58 @@ jobs:
id-token: write

steps:
- name: Checkout
- name: Checkout main repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout Docusaurus repo
uses: actions/checkout@v4
with:
repository: drusco/docusaurus
ref: nexos
path: docusaurus

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"

- name: Cache node_modules
- name: Cache npm global store
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'docusaurus/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Root dependencies
- name: Install root dependencies
run: npm ci

- name: Cache Docusaurus node_modules
uses: actions/cache@v4
with:
path: docusaurus/node_modules
key: ${{ runner.os }}-node-docusaurus-${{ hashFiles('docusaurus/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-docusaurus-

- name: Install Docusaurus dependencies
run: npm ci
working-directory: ./docusaurus
working-directory: docusaurus

- name: Get the Git tag
run: |
# Debug: Check the status of the repository
git status

# Try to get the latest tag, fallback if no tag exists
TAG_NAME=$(git describe --tags --abbrev=0 || echo "No tags found")
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV

# Debug: Print out the list of tags
git tag

# Check if the tag is a pre-release (adjust logic for `next` versions)
if [[ "$TAG_NAME" == "No tags found" ]]; then
IS_PRERELEASE="true"
elif [[ "$TAG_NAME" == *"-next"* ]]; then
IS_PRERELEASE="true"
else
# Check if the tag contains '-next' to consider it a pre-release
if [[ "$TAG_NAME" == *"-next"* ]]; then
IS_PRERELEASE="true"
else
IS_PRERELEASE="false"
fi
IS_PRERELEASE="false"
fi

echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV

- name: Version Docs with Docusaurus
- name: Build and package docs
working-directory: docusaurus
run: |
# Ensure you're in the correct directory
cd docusaurus

# Run docs:version with 'next' for pre-releases, else use the tag name
if [ "$IS_PRERELEASE" == "true" ]; then
echo "Pre-release detected. Using 'next' as the version name."
npx docusaurus docs:version next
Expand All @@ -89,10 +76,8 @@ jobs:
npx docusaurus docs:version "${TAG_NAME#v}"
fi

# Ensure versioned_docs and versioned_sidebars directories exist
if [ -d "$PWD/versioned_docs" ] && [ -d "$PWD/versioned_sidebars" ]; then
# Tar with both versioned_docs and versioned_sidebars at the top level
tar -czf docs.tar.gz -C "$PWD" versioned_docs -C "$PWD" versioned_sidebars
if [ -d "versioned_docs" ] && [ -d "versioned_sidebars" ]; then
tar -czf docs.tar.gz versioned_docs versioned_sidebars
else
echo "Error: versioned_docs or versioned_sidebars directories do not exist!"
exit 1
Expand Down
23 changes: 3 additions & 20 deletions .github/workflows/code-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,17 @@ jobs:
with:
node-version-file: ".node-version"

- name: Cache node_modules
- name: Cache npm cache directory
uses: actions/cache@v4
with:
path: node_modules
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: Cache Docusaurus node_modules
uses: actions/cache@v4
with:
path: docusaurus/node_modules
key: ${{ runner.os }}-node-docusaurus-${{ hashFiles('docusaurus/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-docusaurus-

- name: Install Docusaurus dependencies
run: npm ci
working-directory: ./docusaurus

- name: Run nexos validation
run: |
npm run type-check && npm run lint-check && npm run format-check

- name: Run docusaurus validation
working-directory: ./docusaurus
- name: Run validation
run: |
npm run type-check && npm run lint-check && npm run format-check
31 changes: 15 additions & 16 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,37 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Checkout main repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout Docusaurus repo
uses: actions/checkout@v4
with:
repository: drusco/docusaurus
ref: nexos
path: docusaurus

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"

- name: Cache root node_modules
- name: Cache npm global store
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'docusaurus/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install root dependencies
run: npm ci

- name: Cache Docusaurus node_modules
uses: actions/cache@v4
with:
path: docusaurus/node_modules
key: ${{ runner.os }}-node-docusaurus-${{ hashFiles('docusaurus/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-docusaurus-

- name: Install Docusaurus dependencies
run: npm ci
working-directory: ./docusaurus
working-directory: docusaurus

- name: Fetch Latest Pre-Release Tag
id: pre_release_tag
Expand Down Expand Up @@ -138,16 +137,16 @@ jobs:
fi

- name: Check versions.json
run: cat ./docusaurus/versions.json
run: cat docusaurus/versions.json

- name: Build Docusaurus
run: npm run build
working-directory: ./docusaurus
working-directory: docusaurus

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./docusaurus/build"
path: "docusaurus/build"

- name: Deploy to GitHub Pages
id: deployment
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
with:
node-version-file: ".node-version"

- name: Cache node_modules
- name: Cache npm cache directory
uses: actions/cache@v4
with:
path: node_modules
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
node-version-file: ".node-version"

- name: Cache node_modules
- name: Cache npm cache directory
uses: actions/cache@v4
with:
path: node_modules
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
with:
node-version-file: ".node-version"

- name: Cache root node_modules
- name: Cache npm cache directory
uses: actions/cache@v4
with:
path: node_modules
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dist
build
docusaurus/docs/api/*
docusaurus
coverage
node_modules
.vscode
Expand Down
5 changes: 1 addition & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
dist
coverage
docusaurus/build
docusaurus/.docusaurus
docusaurus/versioned_docs
docusaurus/versioned_sidebars
docusaurus
28 changes: 0 additions & 28 deletions docusaurus/.eslintrc.json

This file was deleted.

27 changes: 0 additions & 27 deletions docusaurus/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions docusaurus/.husky/pre-commit

This file was deleted.

1 change: 0 additions & 1 deletion docusaurus/.husky/prepare-commit-msg

This file was deleted.

1 change: 0 additions & 1 deletion docusaurus/.node-version

This file was deleted.

4 changes: 0 additions & 4 deletions docusaurus/.prettierignore

This file was deleted.

41 changes: 0 additions & 41 deletions docusaurus/README.md

This file was deleted.

Loading
Loading