Add Nuitka binary builds for all platforms
This commit is contained in:
@@ -10,8 +10,75 @@ permissions:
|
|||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-binaries:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
arch: x64
|
||||||
|
artifact: tsr-linux-x64
|
||||||
|
- os: ubuntu-24.04-arm
|
||||||
|
arch: arm64
|
||||||
|
artifact: tsr-linux-arm64
|
||||||
|
- os: macos-latest
|
||||||
|
arch: arm64
|
||||||
|
artifact: tsr-macos-arm64
|
||||||
|
- os: macos-13
|
||||||
|
arch: x64
|
||||||
|
artifact: tsr-macos-x64
|
||||||
|
- os: windows-latest
|
||||||
|
arch: x64
|
||||||
|
artifact: tsr-windows-x64.exe
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install nuitka
|
||||||
|
pip install -e .
|
||||||
|
|
||||||
|
- name: Build binary (Unix)
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
python -m nuitka \
|
||||||
|
--standalone \
|
||||||
|
--onefile \
|
||||||
|
--output-dir=dist \
|
||||||
|
--output-filename=${{ matrix.artifact }} \
|
||||||
|
--assume-yes-for-downloads \
|
||||||
|
--remove-output \
|
||||||
|
tensors.py
|
||||||
|
|
||||||
|
- name: Build binary (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
run: |
|
||||||
|
python -m nuitka `
|
||||||
|
--standalone `
|
||||||
|
--onefile `
|
||||||
|
--output-dir=dist `
|
||||||
|
--output-filename=${{ matrix.artifact }} `
|
||||||
|
--assume-yes-for-downloads `
|
||||||
|
--remove-output `
|
||||||
|
tensors.py
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.artifact }}
|
||||||
|
path: dist/${{ matrix.artifact }}
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-binaries
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -38,12 +105,24 @@ jobs:
|
|||||||
- name: Build package
|
- name: Build package
|
||||||
run: python -m build
|
run: python -m build
|
||||||
|
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: binaries
|
||||||
|
|
||||||
|
- name: Prepare release assets
|
||||||
|
run: |
|
||||||
|
mkdir -p release
|
||||||
|
cp dist/* release/
|
||||||
|
find binaries -type f -exec cp {} release/ \;
|
||||||
|
ls -la release/
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: dist/*
|
files: release/*
|
||||||
prerelease: ${{ steps.version.outputs.prerelease }}
|
prerelease: ${{ steps.version.outputs.prerelease }}
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "tensors"
|
name = "tensors"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
description = "Read safetensor metadata and fetch CivitAI model information"
|
description = "Read safetensor metadata and fetch CivitAI model information"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
Reference in New Issue
Block a user