add build wheel

This commit is contained in:
Roberts Slisans 2024-11-17 23:18:34 +02:00 committed by GitHub
parent 9b1671e4f8
commit 09ffec66fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 65 additions and 0 deletions

65
.github/workflows/build_wheel.yml vendored Normal file
View file

@ -0,0 +1,65 @@
name: Build wheel
on:
workflow_dispatch:
create:
tags:
- v*
jobs:
build:
permissions: write-all
strategy:
max-parallel: 4
matrix:
platform: [ubuntu-latest]
python-version: ["3.10"]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Deps
run: python -m pip install . torch==2.3.1 wheel ninja
- name: Build the wheel
run: python setup.py bdist_wheel -d dist/
- run: du -h dist/*
- uses: actions/upload-artifact@v4
with:
path: dist/*.whl
- name: Log Built Wheels
run: |
ls dist
- name: Set wheel name
run: echo "wheel_name=$(basename dist/*.whl)" >> $GITHUB_ENV
- name: Get the tag version
id: extract_branch
run: echo ::set-output name=branch::${GITHUB_REF#refs/tags/}
- name: Get Release with tag
id: get_current_release
uses: joutvhu/get-release@v1
with:
tag_name: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_current_release.outputs.upload_url }}
asset_path: ./dist/${{env.wheel_name}}
asset_name: ${{env.wheel_name}}
asset_content_type: application/*