From 09ffec66faba06ead0275212a3621fe74e90ed38 Mon Sep 17 00:00:00 2001 From: Roberts Slisans Date: Sun, 17 Nov 2024 23:18:34 +0200 Subject: [PATCH] add build wheel --- .github/workflows/build_wheel.yml | 65 ++++++++++++++++++++++ .github/{publish => workflows/publish.yml} | 0 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/build_wheel.yml rename .github/{publish => workflows/publish.yml} (100%) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml new file mode 100644 index 0000000..5edee14 --- /dev/null +++ b/.github/workflows/build_wheel.yml @@ -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/* \ No newline at end of file diff --git a/.github/publish b/.github/workflows/publish.yml similarity index 100% rename from .github/publish rename to .github/workflows/publish.yml