diff --git a/.github/workflows/api_doc.yml b/.github/workflows/api_doc.yml new file mode 100644 index 0000000000..1912d83110 --- /dev/null +++ b/.github/workflows/api_doc.yml @@ -0,0 +1,58 @@ +name: api docs build + +on: + workflow_call: + inputs: + head_ref: + description: 'The head ref (branch name or PR ref)' + required: true + type: string + secrets: + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + workflow_dispatch: +concurrency: + group: gh-pages-deploy-${{ github.event.inputs.head_ref || github.head_ref }} + cancel-in-progress: true +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + environment: aws_storage + steps: + - uses: actions/checkout@v4 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Download artifact + run: | + set -x + aws s3 sync s3://genesis-ai-compiler/ci/taichi/${GITHUB_SHA:0:7}/cp310/ dist/ + - name: Python check + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: manylinux install wheel + run: | + set -x + ls -lh dist/ + pip install dist/*.whl + python -c 'import taichi as ti; ti.init(arch=ti.cpu); print(ti.__version__)' + - name: Build docs + run: | + pip install pdoc + pdoc --output-dir public taichi + - name: Deploy docs + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public + destination_dir: ${{ github.event.inputs.head_ref || github.head_ref }} + keep_files: true + publish_branch: gh-pages diff --git a/.github/workflows/manylinux_wheel.yml b/.github/workflows/manylinux_wheel.yml index 512a2c5056..d1f2e92292 100644 --- a/.github/workflows/manylinux_wheel.yml +++ b/.github/workflows/manylinux_wheel.yml @@ -4,6 +4,8 @@ on: branches: - main workflow_dispatch: +permissions: + contents: write jobs: build_wheel: name: Manylinux wheel Build @@ -33,7 +35,7 @@ jobs: name: manylinux_wheel_${{ matrix.PYTHON_CP_VERSION }} path: wheelhouse/*.whl - upload_to_storaage: + upload_to_storage: name: Manylinux wheel upload runs-on: ubuntu-22.04 needs: build_wheel @@ -63,7 +65,7 @@ jobs: test_wheel: name: Manylinux wheel Test runs-on: ubuntu-22.04 - needs: upload_to_storaage + needs: upload_to_storage environment: aws_storage strategy: matrix: @@ -101,3 +103,11 @@ jobs: - name: manylinux test run: | bash .github/workflows/scripts_new/manylinux_wheel/5_test.sh + api_docs: + uses: ./.github/workflows/api_doc.yml + needs: upload_to_storage + with: + head_ref: ${{ github.head_ref }} + secrets: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}