Skip to content

Commit 1ec7abf

Browse files
committed
Fix workflow, upload to pypi
1 parent 04534a2 commit 1ec7abf

File tree

1 file changed

+63
-65
lines changed

1 file changed

+63
-65
lines changed

.github/workflows/publish-pypi.yaml

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,71 @@ name: Publish to PyPI
33
on:
44
release:
55
types: [created]
6-
# pull_request: # TODO: remove this line
7-
workflow_dispatch:
86

97
jobs:
10-
# publish-tests:
11-
# concurrency:
12-
# group: ${{ github.workflow }}-${{ github.ref }}
13-
# cancel-in-progress: true
14-
# runs-on: [self-hosted, Linux, X64, gpu]
15-
# container:
16-
# image: nvidia/cuda:11.8.0-devel-ubuntu20.04
17-
# options: --gpus all
18-
# steps:
19-
# - name: Install dependencies via apt
20-
# run: |
21-
# apt update && DEBIAN_FRONTEND=noninteractive apt install -y ccache git graphviz
22-
#
23-
# - uses: actions/checkout@v3
24-
#
25-
# - name: Set up Python
26-
# uses: actions/setup-python@v4
27-
# with:
28-
# python-version: "3.8"
29-
#
30-
# - name: Setup cmake
31-
# uses: jwlawson/actions-setup-cmake@v1.13
32-
# with:
33-
# cmake-version: '3.19.x'
34-
#
35-
# - name: Install dependencies via pip
36-
# run: |
37-
# python -m pip install --upgrade pip
38-
# pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116
39-
# pip install -r requirements.txt
40-
# pip install -r requirements-dev.txt
41-
#
42-
# - name: Build hidet
43-
# run: |
44-
# bash scripts/wheel/build_wheel.sh
45-
# WHEEL=$(find ./scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
46-
# echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
47-
# echo "Built wheel: ${{ env.WHEEL_NAME }}"
48-
#
49-
# - name: Install hidet
50-
# run: |
51-
# pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}
52-
#
53-
# # Run tests
54-
#
55-
# - name: Run tests with operator cache cleared
56-
# run: |
57-
# python -m pytest -v --durations=20 --clear-cache ./tests
58-
#
59-
# # Build the docs
60-
#
61-
# - name: Install docs dependencies
62-
# run: |
63-
# pip install -r docs/requirements.txt
64-
#
65-
# - name: Build docs
66-
# run: |
67-
# cd docs; make clean; make html
68-
#
8+
publish-tests:
9+
name: Release Tests
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
runs-on: [self-hosted, Linux, X64, gpu]
14+
container:
15+
image: nvidia/cuda:11.8.0-devel-ubuntu20.04
16+
options: --gpus all
17+
steps:
18+
- name: Install dependencies via apt
19+
run: |
20+
apt update && DEBIAN_FRONTEND=noninteractive apt install -y ccache git graphviz
21+
22+
- uses: actions/checkout@v3
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: "3.8"
28+
29+
- name: Setup cmake
30+
uses: jwlawson/actions-setup-cmake@v1.13
31+
with:
32+
cmake-version: '3.19.x'
33+
34+
- name: Install dependencies via pip
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116
38+
pip install -r requirements.txt
39+
pip install -r requirements-dev.txt
40+
41+
- name: Build hidet
42+
run: |
43+
bash scripts/wheel/build_wheel.sh
44+
WHEEL=$(find ./scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
45+
echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
46+
echo "Built wheel: ${{ env.WHEEL_NAME }}"
47+
48+
- name: Install hidet
49+
run: |
50+
pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}
51+
52+
# Run tests
53+
54+
- name: Run tests with operator cache cleared
55+
run: |
56+
python -m pytest -v --durations=20 --clear-cache ./tests
57+
58+
# Build the docs
59+
60+
- name: Install docs dependencies
61+
run: |
62+
pip install -r docs/requirements.txt
63+
64+
- name: Build docs
65+
run: |
66+
cd docs; make clean; make html
67+
6968
publish:
70-
name: publish
71-
# needs: [publish-tests] # require tests to pass before deploy runs
69+
name: Publish to PyPI
70+
needs: [publish-tests] # require tests to pass before deploy runs
7271
if: github.event_name == 'release' && github.event.action == 'created' && startsWith(github.event.release.tag_name, 'v')
7372
runs-on: ubuntu-latest
7473
steps:
@@ -88,6 +87,5 @@ jobs:
8887
uses: pypa/gh-action-pypi-publish@v1.5.0
8988
with:
9089
user: __token__
91-
password: ${{ secrets.TEST_PYPI_TOKEN }}
90+
password: ${{ secrets.PYPI_TOKEN }}
9291
packages_dir: scripts/wheel/built_wheel
93-
repository_url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)