Skip to content

Commit

Permalink
start to splitting traits
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Nov 29, 2023
2 parents 446fa0f + 3f2d737 commit fba9b8d
Show file tree
Hide file tree
Showing 181 changed files with 25,767 additions and 14,954 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/cli-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ jobs:
sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: Install gon (macOS)
# https://github.com/mitchellh/gon
run: brew install mitchellh/gon/gon
# Fork of https://github.com/mitchellh/gon
# https://github.com/Bearer/gon
# Since we're dealing with code signing secrets we want to pin the version of gon
run: |
wget https://raw.githubusercontent.com/Bearer/homebrew-tap/366bc999e14a8d04e07e24f9387bcbaf89c1bc53/Formula/gon.rb
brew install --formula gon.rb
rm gon.rb
if: matrix.os == 'macos-latest'

- name: Install LLVM and Clang (Windows) # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@ jobs:
- name: Run cargo-license-template
run: cargo ci-license

check-docs:
name: Check Documentation
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings

steps:
- name: Checkout the Source Code
uses: actions/checkout@v3

- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
toolchain: nightly
components: rustfmt

- name: Install Required Dependencies
run: |
sudo apt-get update
sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: Run cargo-doc
run: cargo ci-doc

audit:
name: Perform Security Audit
runs-on: ubuntu-latest
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/upload-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and upload API docs

on:
release:
types: [published]

env:
GH_TOKEN: ${{ github.token }}

permissions:
actions: 'write'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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: Check if release language is supported
if: steps.get_release_language.outputs.LANGUAGE != 'python' && steps.get_release_language.outputs.LANGUAGE != 'nodejs'
run: gh run cancel ${{ github.run_id }}

- name: Set up Rust
uses: ./.github/actions/setup-rust

- name: Set Up Node.js 18 and Yarn Cache
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install Required Dependencies (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install libudev-dev libusb-1.0-0-dev
- 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 -
- 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/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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ address.json
.DS_Store
book
.venv*

# Temporary documentation
docs
Loading

0 comments on commit fba9b8d

Please sign in to comment.