Bump version: 0.102.1.rc → 0.102.1 #113
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: Tensornet | |
| on: | |
| push: | |
| branches: | |
| - '**' # matches every branch | |
| tags: | |
| - 'v[0-9]+' | |
| - 'v[0-9]+.[a-z0-9]+' | |
| - 'v[0-9]+.[0-9]+.[a-z0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+.[a-z0-9]+' | |
| pull_request: | |
| env: | |
| PIXI_LOCKED: "true" | |
| OMPI_ALLOW_RUN_AS_ROOT: 1 | |
| OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up pixi | |
| uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.49.0 | |
| environments: tools | |
| - name: pre-commit | |
| run: ./pixiw run pre-commit-run --color=always --show-diff-on-failure | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up pixi | |
| uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.49.0 | |
| environments: default py35 py36 py37 | |
| - name: Build with debug profile | |
| run: ./pixiw run build | |
| - name: Verify that the dynamic libraries only requires glibc <= 2.12 | |
| run: | | |
| err=0 | |
| objdump -T build/debug/libtensornet.so | grep GLIBC_ | grep -v '0000000000000000\s*w\s*DF' | grep -v 'GLIBC_\([01]\|2\.[0-9]\|2\.1[012]\)[^0-9]' || err=$? | |
| test $err = 1 | |
| err=0 | |
| objdump -T build/debug/_pywrap_tn.cpython-38-x86_64-linux-gnu.so | grep GLIBC_ | grep -v '0000000000000000\s*w\s*DF' | grep -v 'GLIBC_\([01]\|2\.[0-9]\|2\.1[012]\)[^0-9]' || err=$? | |
| test $err = 1 | |
| create-wheel-cmake: | |
| name: create wheel / cmake | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up pixi | |
| uses: prefix-dev/[email protected] | |
| with: | |
| pixi-version: v0.49.0 | |
| environments: default py35 py36 py37 tools | |
| - name: Create wheel | |
| run: | | |
| ./pixiw run create-wheel | |
| ./pixiw run -e tools check-wheel-contents dist | |
| grep -q '^tensornet$' qihoo_tensornet.egg-info/top_level.txt | |
| ls -alh dist | |
| - name: Store wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: dist/ | |
| retention-days: 7 | |
| create-wheel-bazel: | |
| name: create wheel / bazel | |
| runs-on: ubuntu-latest | |
| env: | |
| NEED_ACTIVATE_ENV: "false" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| micromamba-version: '1.5.8-0' | |
| environment-file: config/tn_build.yaml | |
| init-shell: bash | |
| cache-downloads: true | |
| post-cleanup: 'none' | |
| - name: Build the core library | |
| run: | | |
| set -e | |
| ./manager build | |
| ./manager copy-libs | |
| rm -rf /home/runner/.cache/bazel # remove bazel cache to avoid job hang | |
| shell: micromamba-shell {0} | |
| - name: Create wheel | |
| run: | | |
| ./manager create_dist | |
| grep -q '^tensornet$' qihoo_tensornet.egg-info/top_level.txt | |
| ls -alh dist | |
| shell: micromamba-shell {0} | |
| publish-to-pypi: | |
| name: Upload to pypi | |
| if: github.repository == 'Qihoo360/tensornet' && startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
| needs: | |
| - create-wheel-cmake | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # mandatory for pypi trusted publishing | |
| contents: write # mandatory for create a github release | |
| steps: | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| path: dist/ | |
| - name: Publish wheels to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| # push v*.rc* tags to test.pypi.org | |
| repository-url: ${{ contains(github.ref, '.rc') && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' | |
| }} | |
| print-hash: true | |
| - name: Create a draft release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| prerelease: ${{ contains(github.ref, '.rc') }} | |
| generate_release_notes: true |