Skip to content

Commit b560302

Browse files
authored
fix: Add build to typedoc step (#105)
Actually build the docs, and fix the deployment process.
1 parent 7bc0855 commit b560302

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const config = {
1616
"**/test-apps/**",
1717
"**/integration-tests/**/*.cjs",
1818
"**/integration-tests/test-api/**/*",
19-
"**/scripts/publish-docs.js",
19+
"**/scripts/publish-docs.mjs",
2020
"**/typedoc/plugin-remove-references.js",
2121
],
2222
parserOptions: {

.github/workflows/typedoc_manual_deploy.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,29 @@ on:
55

66
jobs:
77
deploy_docs:
8+
permissions:
9+
contents: 'write'
810
name: Deploy TypeDocs
911
runs-on: ubuntu-latest
1012
steps:
1113
- name: Checkout Repo
1214
uses: actions/checkout@v4
1315

16+
- name: Import GPG key
17+
id: import-gpg
18+
uses: crazy-max/ghaction-import-gpg@v6
19+
with:
20+
gpg_private_key: ${{ secrets.RELEASER_GPG_PRIVATE_KEY }}
21+
git_user_signingkey: true
22+
git_commit_gpgsign: true
23+
git_config_global: true
24+
25+
- name: Setup Git
26+
run: |
27+
echo "machine github.com login x password ${{ secrets.GITHUB_TOKEN }}" > ~/.netrc
28+
git config --global url."https://github.com/".insteadOf "git://github.com/"
29+
git config --global advice.detachedHead false
30+
1431
- name: Set up Node
1532
uses: actions/setup-node@v4
1633
with:
@@ -23,4 +40,7 @@ jobs:
2340
run_install: true
2441

2542
- name: Publish new docs
26-
run: node scripts/publish-docs.js
43+
run: node scripts/publish-docs.mjs
44+
env:
45+
GIT_USERNAME: ${{ steps.import-gpg.outputs.name }}
46+
GIT_EMAIL: ${{ steps.import-gpg.outputs.email }}

scripts/publish-docs.js renamed to scripts/publish-docs.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { execSync } from "child_process";
22

33
function buildDocs() {
44
execSync("rm -rf ./typedoc/docs");
5+
execSync("pnpm run build");
56
execSync("pnpm run generate:typedoc");
67
}
78

@@ -10,9 +11,11 @@ function publishDocs() {
1011
mkdir /tmp/js-docs
1112
cp -r ./typedoc/docs /tmp/js-docs/docs
1213
cd /tmp/js-docs && \
13-
git clone --single-branch --branch gh-pages git@github.com:codecov/codecov-javascript-bundler-plugins.git && \
14+
git clone --single-branch --branch gh-pages https://github.com/codecov/codecov-javascript-bundler-plugins.git && \
1415
cp -r /tmp/js-docs/docs/* /tmp/js-docs/codecov-javascript-bundler-plugins/ && \
1516
cd /tmp/js-docs/codecov-javascript-bundler-plugins && \
17+
git config --global user.name "codecov-releaser" && \
18+
git config --global user.email "[email protected]" && \
1619
git add --all && \
1720
git commit -m "meta: Update docs" && \
1821
git push origin gh-pages`);

typedoc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"$schema": "https://typedoc.org/schema.json",
33
"readme": "README.md",
4-
"name": "Codecov JavaScript Bundler PLugins",
4+
"name": "Codecov JavaScript Bundler Plugins",
55
"entryPoints": ["packages/*"],
66
"entryPointStrategy": "packages",
77
"out": "./typedoc/docs",
8-
"includeVersion": true,
8+
"includeVersion": false,
99
"excludePrivate": true,
1010
"excludeExternals": true,
1111
"excludeReferences": true,

0 commit comments

Comments
 (0)