Build and upload API docs #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.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 |