Skip to content

Commit

Permalink
Fix workflow, upload to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyaoding committed Jan 13, 2023
1 parent 04534a2 commit 1ec7abf
Showing 1 changed file with 63 additions and 65 deletions.
128 changes: 63 additions & 65 deletions .github/workflows/publish-pypi.yaml
Expand Up @@ -3,72 +3,71 @@ name: Publish to PyPI
on:
release:
types: [created]
# pull_request: # TODO: remove this line
workflow_dispatch:

jobs:
# publish-tests:
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
# runs-on: [self-hosted, Linux, X64, gpu]
# container:
# image: nvidia/cuda:11.8.0-devel-ubuntu20.04
# options: --gpus all
# steps:
# - name: Install dependencies via apt
# run: |
# apt update && DEBIAN_FRONTEND=noninteractive apt install -y ccache git graphviz
#
# - uses: actions/checkout@v3
#
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.8"
#
# - name: Setup cmake
# uses: jwlawson/actions-setup-cmake@v1.13
# with:
# cmake-version: '3.19.x'
#
# - name: Install dependencies via pip
# run: |
# python -m pip install --upgrade pip
# pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116
# pip install -r requirements.txt
# pip install -r requirements-dev.txt
#
# - name: Build hidet
# run: |
# bash scripts/wheel/build_wheel.sh
# WHEEL=$(find ./scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
# echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
# echo "Built wheel: ${{ env.WHEEL_NAME }}"
#
# - name: Install hidet
# run: |
# pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}
#
# # Run tests
#
# - name: Run tests with operator cache cleared
# run: |
# python -m pytest -v --durations=20 --clear-cache ./tests
#
# # Build the docs
#
# - name: Install docs dependencies
# run: |
# pip install -r docs/requirements.txt
#
# - name: Build docs
# run: |
# cd docs; make clean; make html
#
publish-tests:
name: Release Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
runs-on: [self-hosted, Linux, X64, gpu]
container:
image: nvidia/cuda:11.8.0-devel-ubuntu20.04
options: --gpus all
steps:
- name: Install dependencies via apt
run: |
apt update && DEBIAN_FRONTEND=noninteractive apt install -y ccache git graphviz
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.19.x'

- name: Install dependencies via pip
run: |
python -m pip install --upgrade pip
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Build hidet
run: |
bash scripts/wheel/build_wheel.sh
WHEEL=$(find ./scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
echo "Built wheel: ${{ env.WHEEL_NAME }}"
- name: Install hidet
run: |
pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}
# Run tests

- name: Run tests with operator cache cleared
run: |
python -m pytest -v --durations=20 --clear-cache ./tests
# Build the docs

- name: Install docs dependencies
run: |
pip install -r docs/requirements.txt
- name: Build docs
run: |
cd docs; make clean; make html
publish:
name: publish
# needs: [publish-tests] # require tests to pass before deploy runs
name: Publish to PyPI
needs: [publish-tests] # require tests to pass before deploy runs
if: github.event_name == 'release' && github.event.action == 'created' && startsWith(github.event.release.tag_name, 'v')
runs-on: ubuntu-latest
steps:
Expand All @@ -88,6 +87,5 @@ jobs:
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: scripts/wheel/built_wheel
repository_url: https://test.pypi.org/legacy/

0 comments on commit 1ec7abf

Please sign in to comment.