install pybind11 #160
Workflow file for this run
This file contains hidden or 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: Release on Tag | ||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" # 只对形如 v1.2.3 的 tag 触发 | ||
| env: | ||
| RELEASE_PATH: "${{ vars.CI_BASE_PATH }}/GitHub/Release/${{ github.repository }}/${GITHUB_RUN_NUMBER}" | ||
| THIRD_PARTY_PATH: "${{ vars.CI_BASE_PATH }}/data/DLCompiler/third_party" | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| release: | ||
| if: github.repository == 'DeepLink-org/DLCompiler' | ||
| runs-on: DLC-60 | ||
| steps: | ||
| - name: Checkout code via SSH | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ssh-key: ${{ secrets.SSH_PRIVATE_KEY_DLC_CI }} | ||
| - name: Create custom directory | ||
| run: | | ||
| set -ex | ||
| echo ${{ env.RELEASE_PATH }} | ||
| mkdir -p ${{ env.RELEASE_PATH }} | ||
| - name: Clean custom directory | ||
| run: | | ||
| set -ex | ||
| if [ -d "${{ env.RELEASE_PATH }}" ]; then | ||
| rm -rf ${{ env.RELEASE_PATH }}/* | ||
| rm -rf ${{ env.RELEASE_PATH }}/.github | ||
| fi | ||
| - name: Move code to custom directory | ||
| run: | | ||
| set -ex | ||
| mv $GITHUB_WORKSPACE/* ${{ env.RELEASE_PATH }}/ | ||
| mv $GITHUB_WORKSPACE/.github ${{ env.RELEASE_PATH }}/ | ||
| mv $GITHUB_WORKSPACE/.git ${{ env.RELEASE_PATH }}/ | ||
| - name: Setup Git Safe Directory | ||
| run: | | ||
| git config --global --add safe.directory '*' | ||
| - name: Install build dependencies | ||
| run: | | ||
| pip install build twine pybind11 -i https://mirrors.huaweicloud.com/repository/pypi/simple | ||
| - name: Build DLCompiler | ||
| run: | | ||
| set -ex | ||
| source /home/dlc_ci/.bashrc | ||
| source activate dlcompiler | ||
| source /usr/local/Ascend/ascend-toolkit/set_env.sh | ||
| cd ${{ env.RELEASE_PATH }} | ||
| export JSON_PATH34=${{ vars.CI_BASE_PATH }}/data/v34/include.zip | ||
| export GOOGLETEST_DIR34=${{ vars.CI_BASE_PATH }}/data/v34/googletest | ||
| export LLVM_TGZ_PATH34=${{ vars.CI_BASE_PATH }}/data/v34/llvm-064f02da-ubuntu-arm64.tar.gz | ||
| rm -rf ./third_party/* | ||
| git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/ascendnpu-ir ./third_party/ascendnpu-ir | ||
| git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/json ./third_party/json | ||
| git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/triton_shared ./third_party/triton_shared | ||
| git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/triton ./third_party/triton | ||
| echo "whoami? $(whoami)" | ||
| echo "which python? $(which python)" | ||
| git submodule update --init | ||
| echo "git submodule update done." | ||
| pip install nanobind -i https://mirrors.huaweicloud.com/repository/pypi/simple | ||
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | ||
| bash compile_shared.sh apply_patch=true build_package=true | ||
| fi | ||
| - name: Create Release and Upload Assets | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: | | ||
| third_party/triton/dist/*.whl | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| working-directory: ${{ env.RELEASE_PATH }} | ||
| - name: Clear workfile | ||
| if: always() | ||
| run: | | ||
| export workdir=$(pwd) | ||
| cd .. | ||
| rm -rf $workdir | ||
| mkdir $workdir | ||
| chmod -R 777 $workdir | ||
| if [ -d "${{ env.RELEASE_PATH }}" ]; then | ||
| rm -rf ${{ env.RELEASE_PATH }} | ||
| fi | ||