Skip to content

Commit

Permalink
fix: add auto docgen api
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Feb 3, 2023
1 parent a6ba294 commit 38a547a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
- name: Update Readme
run: pnpm docgen
run: pnpm docgen && pnpm docgen:api
- name: Add readme
run: git add README.md
- name: Create bump and changelog main
Expand All @@ -48,6 +48,16 @@ jobs:
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git pull $remote_repo $CURRENT_BRANCH
git push $remote_repo HEAD:$CURRENT_BRANCH --follow-tags --tags
- name: Push generated doc to doc repo
uses: nkoppel/push-files-to-another-repository@1.1.0
env:
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
source-files: 'api.md'
destination-username: 'Cap-go'
destination-repository: 'docs'
destination-directory: 'plugin'
commit-email: 'martindonadieu@gmail.com'
create-cache:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: All available method of the plugin
---

<docgen-index>

</docgen-index>

<docgen-api>


</docgen-api>
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"prettier": "prettier --config .prettierrc.js \"**/*.{css,html,ts,js,java}\"",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api CapacitorUpdaterPlugin --output-readme README.md --output-json dist/docs.json",
"docgen:api": "docgen --api CapacitorUpdaterPlugin --output-readme api.md --output-json dist/docs.json",
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
"clean": "rimraf ./dist",
"watch": "tsc --watch",
Expand Down

0 comments on commit 38a547a

Please sign in to comment.