Skip to content

Commit 737bd68

Browse files
committed
Tweak typedoc action
1 parent 80b5c5b commit 737bd68

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

.github/workflows/docs.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,28 @@ jobs:
3333
- run: npm install -g npm@10
3434
- run: npm install
3535

36-
- name: Set TAG env to devel (default)
36+
- name: Set VERSION env to devel (default)
3737
run: |
38-
echo "TAG=devel" >> $GITHUB_ENV
38+
echo "VERSION=devel" >> $GITHUB_ENV
3939
echo "IS_PREVIEW=1" >> $GITHUB_ENV
4040
echo "IS_BACKPORT=0" >> $GITHUB_ENV
4141
42-
- name: Set TAG env to ref tag
43-
if: startsWith( github.event.ref, 'refs/tags/v' )
42+
- name: Set VERSION env from tag name
43+
if: startsWith(github.ref, 'refs/tags/v')
4444
run: |
45-
export TAG=$(echo ${{ github.event.ref }} | sed -e 's/^refs\/tags\/v//')
46-
echo "TAG=${TAG}" >> $GITHUB_ENV
47-
echo "IS_PREVIEW=$(node -p "Number('${TAG}'.includes('-'))")" >> $GITHUB_ENV
48-
echo "IS_BACKPORT=$(node -p "Number(require('semver').lt('${TAG}','$(tail -n 1 gh-pages/VERSION.md)'))")" >> $GITHUB_ENV
45+
export REF_NAME=${{github.ref_name}}
46+
export VERSION=${REF_NAME:1}
47+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
48+
echo "IS_PREVIEW=$(node -p "Number('${VERSION}'.includes('-'))")" >> $GITHUB_ENV
49+
echo "IS_BACKPORT=$(node -p "Number(require('semver').lt('${VERSION}','$(tail -n 1 gh-pages/VERSION.md)'))")" >> $GITHUB_ENV
4950
5051
- name: Update VERSION / latest
51-
if: env.IS_PREVIEW != 1
52+
if: env.IS_BACKPORT != 1 && env.IS_PREVIEW != 1
5253
run: |
5354
echo '---\npermalink: /VERSION\ntitle: "VERSION"\n---\n' > gh-pages/VERSION.md
54-
echo $TAG >> gh-pages/VERSION
55+
echo $VERSION >> gh-pages/VERSION
5556
unlink gh-pages/latest
56-
ln -s $TAG gh-pages/latest
57+
ln -s $VERSION gh-pages/latest
5758
5859
- name: Update CHANGELOG / MIGRATING
5960
if: env.IS_BACKPORT != 1
@@ -65,24 +66,24 @@ jobs:
6566
6667
- name: Remove old docs if present
6768
run: |
68-
rm -rf gh-pages/${TAG}
69+
rm -rf gh-pages/${VERSION}
6970
7071
- name: Rebuild docs for tag
71-
if: env.TAG != 'devel'
72+
if: env.VERSION != 'devel'
7273
run: |
73-
./node_modules/.bin/typedoc --includeVersion --gitRevision ${TAG} --out gh-pages/${TAG}
74+
./node_modules/.bin/typedoc --includeVersion --gitRevision ${{ github.ref_name }} --out gh-pages/${VERSION}
7475
node -p 'var all=fs.readdirSync("gh-pages",{withFileTypes:true}).flatMap(f=>f.isDirectory()&&!isNaN(f.name.charAt(0))?[f.name]:[]).sort(require("semver").rcompare);JSON.stringify({all,stable:all.filter(s=>!s.includes("-"))})' > gh-pages/_data/versions.json
7576
7677
- name: Rebuild docs for devel
77-
if: env.TAG == 'devel'
78+
if: env.VERSION == 'devel'
7879
run: |
79-
./node_modules/.bin/typedoc --out gh-pages/${TAG}
80+
./node_modules/.bin/typedoc --gitRevision ${{ github.sha }} --out gh-pages/${VERSION}
8081
8182
- name: Commit to gh-pages
8283
uses: EndBug/add-and-commit@v9
8384
with:
8485
cwd: ./gh-pages
8586
push: origin gh-pages --force
86-
message: Update ${{ env.TAG }} docs via ${{ github.sha }}
87+
message: Update ${{ env.VERSION }} docs via ${{ github.sha }}
8788
env:
8889
GITHUB_TOKEN: ${{ github.token }}

typedoc.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{
22
"out": "tsdoc",
3+
"cacheBust": true,
34
"githubPages": true,
45
"disableSources": false,
56
"exclude": ["**/lib/*.ts", "**/test/*.ts"],
67
"basePath": "./src",
8+
"gitRemote": "origin",
79
"visibilityFilters": {},
8-
"intentionallyNotExported": [
9-
"ArangojsError",
10-
"ArangojsResponse",
11-
"Blob",
12-
"GeneratedAqlQuery"
13-
],
10+
"intentionallyNotExported": ["Blob", "GeneratedAqlQuery"],
1411
"excludeInternal": true,
1512
"excludeProtected": true,
1613
"excludePrivate": true,

0 commit comments

Comments
 (0)