Skip to content

Commit

Permalink
feat: update typedoc plugin
Browse files Browse the repository at this point in the history
- updated ci workflows
- added typedoc version plugin
  • Loading branch information
Bugs5382 committed Oct 31, 2024
1 parent 5f5cc9a commit 993380f
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 145 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/dependabot-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GH_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
skip-commit-verification: true
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -32,7 +32,7 @@ jobs:
fi
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests
run: |
npm test
Expand All @@ -42,11 +42,11 @@ jobs:
PR_URL=$(gh pr list --json state:open author:dependabot[bot] base:$PR_BASE_BRANCH -q '.[].url' | jq -r 'join(" ")')
echo "::set-output name=pr_url::$PR_URL"
env:
PR_BASE_BRANCH: develop
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
PR_BASE_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge aggregated PRs
if: steps.aggregate_prs.outputs.pr_url != ''
run: |
gh pr merge --auto --merge ${{ steps.aggregate_prs.outputs.pr_url }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 changes: 0 additions & 97 deletions .github/workflows/deploy-ci.yaml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release and Publish
on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
Test:
uses: ./.github/workflows/test.yaml

Publish:
needs: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create Directory
run: mkdir -p ./lib ./node_modules

- name: Download the build artifact
uses: actions/download-artifact@v4
with:
name: cache
path: ./

- name: Build
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install dependencies
run: npm ci

- name: Semantic Release (Dry Run)
run: npm run semantic-release:dry-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Semantic Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Document:
needs: Publish
uses: ./.github/workflows/docs.yaml

89 changes: 89 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Publish Docs
on:
workflow_dispatch:
workflow_call:
permissions:
contents: write

jobs:
History:
runs-on: ubuntu-latest
steps:
- name: Get the gh-pages repo
uses: actions/checkout@v4
with:
ref: gh-pages

- name: TAR the existing docs
run: |
mkdir -p ./docs
tar -cvf documentation.tar ./docs
- name: Create a document artifact
uses: actions/upload-artifact@v4
with:
name: documentation
path: documentation.tar
Build:
needs: History
runs-on: ubuntu-latest
steps:
- name: Checkout src
uses: actions/checkout@v4

- name: Create Directory
run: mkdir -p ./docs

- name: Download the existing documents artifact
uses: actions/download-artifact@v4
with:
name: documentation

- run: tar -xf documentation.tar ./docs -C ./docs

- name: Build
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install NPM
run: npm install --ignore-scripts

- name: Build Documents
run: npm run typedoc

- name: Tar the new docs
run: tar -cvf newdocumentation.tar ./docs

- name: Create a new document artifact
uses: actions/upload-artifact@v4
with:
name: newdocumentation
path: newdocumentation.tar
Commit:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the gh-pages repo
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Create Directory
run: mkdir -p ./docs

- name: Download the new documents artifact
uses: actions/download-artifact@v4
with:
name: newdocumentation

- name: Extract Tar
run: tar -xf newdocumentation.tar ./docs -C ./docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
34 changes: 0 additions & 34 deletions .github/workflows/pr-unit-tests.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test
on:
workflow_dispatch:
workflow_call:
pull_request:
branches:
- main
types:
- opened
- synchronize

jobs:
Build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 'lts/*', 'latest']
steps:
- uses: actions/checkout@v4

- name: Test with Node ${{matrix.node-version}}
uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version}}

- name: Run
run: |
npm install --package-lock-only
npm install --ignore-scripts
npm run build
npm run test
- name: Upload build artifact
if: matrix.node-version == 'lts/*'
uses: actions/upload-artifact@v4
with:
name: cache
path: |
package.json
package-lock.json
./lib
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,28 @@
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@shipgirl/typedoc-plugin-versions": "^0.2.7",
"@the-rabbit-hole/semantic-release-config": "^1.5.0",
"@types/node": "^22.5.5",
"@types/node": "^22.8.6",
"@types/randomstring": "^1.3.0",
"@types/tcp-port-used": "^1.0.4",
"@typescript-eslint/parser": "^8.6.0",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/ui": "^2.1.1",
"@typescript-eslint/parser": "^8.12.2",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/ui": "^2.1.4",
"fastify": "^5.0.0",
"npm-check-updates": "^17.1.3",
"npm-check-updates": "^17.1.9",
"npm-package-json-lint": "^8.0.0",
"portfinder": "^1.0.32",
"pre-commit": "^1.2.2",
"semantic-release": "^24.1.1",
"semantic-release": "^24.2.0",
"snazzy": "^9.0.0",
"tcp-port-used": "^1.0.2",
"ts-node": "^10.9.2",
"ts-standard": "^12.0.2",
"tsd": "^0.31.2",
"typedoc": "^0.26.7",
"typescript": "^5.6.2",
"vitest": "^2.1.1"
"typedoc": "^0.26.10",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
},
"precommit": [
"lint:fix",
Expand Down
Loading

0 comments on commit 993380f

Please sign in to comment.