Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(headless): updates the Headless typedoc uploading logic #4876

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
59 changes: 31 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,37 +127,39 @@ jobs:
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup

- name: Set up and build the project
uses: ./.github/actions/setup

- name: Build typedoc site
run: npm run build:typedoc
working-directory: packages/headless
shell: bash

- name: Read version from package.json
id: read_version
run: |
VERSION=$(jq -r '.version' packages/headless/package.json)
echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
- name: Zip documentation folder

- name: Copy the docs into the version folder
run: |
DOCS_DIR="packages/headless/docs"
if [ ! -d "$DOCS_DIR" ]; then
echo "Documentation folder $DOCS_DIR not found."
exit 1
fi

ZIP_NAME="headless-docs-${{ env.version }}.zip"
zip -r "$ZIP_NAME" "$DOCS_DIR"
echo "Created zip file: $ZIP_NAME"
mkdir -p typedoc-headless-site/${{ env.version }}/
cp -r packages/headless/docs/* typedoc-headless-site/${{ env.version }}/
echo "Copied docs to: typedoc-headless-site/${{ env.version }}/"

- name: Upload documentation artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: headless-docs-${{ env.version }}
path: headless-docs-${{ env.version }}.zip
path: typedoc-headless-site/

typedoc-headless-react:
needs: release
runs-on: ubuntu-latest
Expand All @@ -167,36 +169,37 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup

- name: Set up and build the project
uses: ./.github/actions/setup

- name: Build typedoc site
run: npm run build:typedoc
working-directory: packages/headless-react
shell: bash

- name: Read version from package.json
id: read_version
run: |
VERSION=$(jq -r '.version' packages/headless-react/package.json)
echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
- name: Zip documentation folder

- name: Copy the docs into the version folder
run: |
DOCS_DIR="packages/headless-react/docs"
if [ ! -d "$DOCS_DIR" ]; then
echo "Documentation folder $DOCS_DIR not found."
exit 1
fi

ZIP_NAME="headless-react-docs-${{ env.version }}.zip"
zip -r "$ZIP_NAME" "$DOCS_DIR"
echo "Created zip file: $ZIP_NAME"
mkdir -p typedoc-headless-react-site/${{ env.version }}/
cp -r packages/headless/docs/* typedoc-headless-react-site/${{ env.version }}/
echo "Copied docs to: typedoc-headless-react-site/${{ env.version }}/"

- name: Upload documentation artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: headless-react-docs-${{ env.version }}
path: headless-react-docs-${{ env.version }}.zip
name: headless-docs-${{ env.version }}
path: typedoc-headless-react-site/

# TODO KIT-3074 Fix the publication into the GitHub Packages, and uncomment
# github-prod:
Expand Down
Loading