forked from tenstorrent/tt-flash
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.42 KB
/
build-and-release-whls.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build and Release Python Wheels
on:
release:
types: [published]
tags:
- 'v*' # Trigger for tags like v1.0, v2.0, ...
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build wheel
run: |
python -m build
- name: Verify wheel files
run: |
twine check dist/*
for file in dist/*.whl; do
if ! [[ $file =~ .*-py3-none-any.whl$ ]]; then
echo "Error: Wheel $file is not marked as pure Python."
exit 1
fi
done
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: dist/*.whl
- name: Upload Wheel Files to Release
uses: softprops/action-gh-release@v2
with:
files: dist/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Publish to PyPI
# if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
# uses: pypa/gh-action-pypi-publish@v1.4.2
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages_dir: dist