-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b626270
commit 41b8596
Showing
2 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,77 @@ | ||
name: Build and upload API docs | ||
|
||
on: | ||
push: | ||
branches: [develop, staging] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
cache-root: bindings/nodejs | ||
|
||
- name: Set Up Node.js 18 and Yarn Cache | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
cache: yarn | ||
cache-dependency-path: bindings/nodejs/yarn.lock | ||
|
||
- name: Install Required Dependencies (Ubuntu) | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libudev-dev libusb-1.0-0-dev | ||
- name: Echo tag | ||
run: echo ${{ github.ref }} | ||
|
||
- name: Get release language | ||
id: get_release_language | ||
run: | | ||
if [[ ${{ github.ref }} == *"python"* ]]; then | ||
echo LANGUAGE="python" >> $GITHUB_OUTPUT | ||
fi | ||
if [[ ${{ github.ref }} == *"nodejs"* ]]; then | ||
echo LANGUAGE="nodejs" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Get release version | ||
id: get_release_version | ||
run: | | ||
VERSION=$(echo ${{ github.ref }} | sed -e 's/.*v\([0-9]*\.[0-9]*\).*/\1/') | ||
echo VERSION=$VERSION >> $GITHUB_OUTPUT | ||
- name: Build python docs | ||
if: steps.get_release_language.outputs.LANGUAGE == 'python' | ||
run: | | ||
cd bindings/python | ||
pip install -r requirements-dev.txt | ||
PYTHONPATH=. pydoc-markdown | ||
cd - | ||
cd - | ||
- name: Build nodejs docs | ||
if: steps.get_release_language.outputs.LANGUAGE == 'nodejs' | ||
run: | | ||
cd bindings/nodejs | ||
# The SDK still uses yarn classic: https://github.com/iotaledger/iota-sdk/issues/433 | ||
yarn set version classic | ||
yarn | ||
yarn create-api-docs --out ../../docs/references/nodejs | ||
cd - | ||
yarn create-api-docs --out ../../docs/nodejs | ||
cd - | ||
- name: Compress generated docs | ||
run: | | ||
tar czvf ${{ steps.get_release_language.outputs.LANGUAGE }}.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 ${{ steps.get_release_language.outputs.LANGUAGE }}.tar.gz s3://files.iota.org/iota-wiki/iota-sdk/${{ steps.get_release_version.outputs.VERSION }}/ --acl public-read |
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