diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 169c786..70227de 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,66 +3,22 @@ name: Release to to PyPi and GitHub on: - push: - tags: - - "*" + workflow_dispatch: + release: + types: [published] jobs: - build_manylinux: - name: Build manylinux wheels - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8, 3.9, "3.10"] - steps: - - uses: actions/checkout@v2 - - name: Install libopus-dev - run: | - sudo apt update - sudo apt -y install libopus-dev - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: messense/maturin-action@v1 - with: - maturin-version: latest - command: build - args: --release -o dist - - uses: actions/upload-artifact@v2 - with: - path: dist/*.whl - build_wheels: name: Build wheels on ${{ matrix.os }} - ${{ matrix.vers }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - include: - # - vers: i686 - # os: ubuntu-20.04 - # - vers: aarch64 - # os: ubuntu-20.04 - # - vers: auto64 - # os: ubuntu-20.04 - - vers: arm64 - os: macos-10.15 - - vers: auto64 - os: macos-10.15 - - vers: auto64 - os: windows-2019 + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: [38, 39, 310, 311] - env: - SCCACHE_VERSION: 0.2.13 - CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y" - CIBW_BUILD_VERBOSITY: "1" # Make some more noise to not stall, and extra debugging. - CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_SKIP: "cp27-* cp34-* cp35-* pp* *-win32" + # env: + # SCCACHE_VERSION: 0.2.13 steps: - uses: actions/checkout@v2 @@ -78,23 +34,10 @@ jobs: with: platforms: all - - name: wheels Linux ${{ matrix.vers }} - if: runner.os == 'Linux' - uses: joerick/cibuildwheel@v1.12.0 - env: - CIBW_ARCHS_LINUX: ${{ matrix.vers }} - - - name: wheels Macos ${{ matrix.vers }} - if: runner.os == 'Macos' + - name: wheels ${{ matrix.os }} ${{ matrix.vers }} uses: joerick/cibuildwheel@v2.2.2 env: - CIBW_ARCHS_MACOS: ${{ matrix.vers }} - - - name: wheels Windows ${{ matrix.vers }} - if: runner.os == 'Windows' - uses: joerick/cibuildwheel@v2.2.2 - env: - CIBW_ARCHS_WINDOWS: ${{ matrix.vers }} + CIBW_BUILD: "cp${{ matrix.python-version}}-*" - uses: actions/upload-artifact@v2 with: @@ -123,7 +66,7 @@ jobs: path: dist/*.tar.gz release: - needs: [build_manylinux, build_wheels, build_sdist] + needs: [build_wheels, build_sdist] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v2 @@ -131,14 +74,14 @@ jobs: name: artifact path: dist - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: target/wheels/lavasnek_rs*.whl - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file + # - name: Release + # uses: softprops/action-gh-release@v1 + # with: + # files: target/wheels/lavasnek_rs*.whl + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - uses: pypa/gh-action-pypi-publish@master + # with: + # user: __token__ + # password: ${{ secrets.PYPI_TOKEN }} diff --git a/install_cmake.sh b/install_cmake.sh new file mode 100644 index 0000000..2015523 --- /dev/null +++ b/install_cmake.sh @@ -0,0 +1,21 @@ +#!bin/sh + +#https://signes.pl/update-cmake-to-version-3-in-centos/ + +sudo set -ex \ + && for key in C6C265324BBEBDC350B513D02D2CEF1034921684; do \ + gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done + +ENV CMAKE_VERSION 3.6.2 + +sudo set -ex \ + && curl -fsSLO --compressed https://cmake.org/files/v3.6/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \ + && curl -fsSLO --compressed https://cmake.org/files/v3.6/cmake-${CMAKE_VERSION}-SHA-256.txt.asc \ + && curl -fsSLO --compressed https://cmake.org/files/v3.6/cmake-${CMAKE_VERSION}-SHA-256.txt \ + && gpg --verify cmake-${CMAKE_VERSION}-SHA-256.txt.asc cmake-${CMAKE_VERSION}-SHA-256.txt \ + && grep "cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz\$" cmake-${CMAKE_VERSION}-SHA-256.txt | sha256sum -c - \ + && tar xzf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -C /usr/local --strip-components=1 --no-same-owner \ + && rm -rf cmake-${CMAKE_VERSION}* diff --git a/pyproject.toml b/pyproject.toml index 58b14dd..5074177 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,6 @@ build-backend = "maturin" requires = ["maturin>=0.12,<0.13"] [project] -version = "0.1.8" -description = "A Discord voice library using Python Songbird bindings." classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", @@ -13,8 +11,10 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = ["yt-dlp>=2021.12.1"] +description = "A Discord voice library using Python Songbird bindings." name = "songbird-py" requires-python = ">=3.8" +version = "0.1.8" [project.optional-dependencies] hikari = ["hikari"] @@ -27,3 +27,19 @@ GitHub = "https://github.com/magpie-dev/Songbird-Py" [tool.maturin] sdist-include = ["songbird/*.pyi"] + +[tool.cibuildwheel] +build-verbosity = "1" + +[tool.cibuildwheel.linux] +archs = ["auto", "aarch64"] +before-build = """ +curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && +yum install -y opus +""" + +[tool.cibuildwheel.macos] +archs = ["auto", "arm64"] + +[tool.cibuildwheel.windows] +archs = ["auto", "arm64"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 966e49e..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -yt-dlp>=2021.12.1 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 2d2c0fd..0000000 --- a/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -# This is only used for readthe docs. Packaging is done with setuptools. - -from setuptools import setup -from setuptools_rust import Binding, RustExtension, Strip - -setup( - name="songbird-py", - author="Lunarmagpie", - description="A Discord voice library using Python Songbird bindings.", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - data_files=[ - "songbird/songbird.pyi" - ], - version="0.1.4", - classifiers=[ - "Programming Language :: Python :: 3", - "Programming Language :: Rust", - "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - "Operating System :: OS Independent", - ], - rust_extensions=[RustExtension("songbird.songbird", binding=Binding.PyO3, strip=Strip.All)], - packages=["songbird"], - install_requires=["yt-dlp"], - url="https://github.com/Lunarmagpie/Songbird-Py", - project_urls={ - "GitHub": "https://github.com/Lunarmagpie/Songbird-Py", - "Docs": "https://songbird-py.readthedocs.io/en/latest/", - "Bug Tracker": "https://github.com/Lunarmagpie/Songbird-Py/issues", - }, - include_package_data=True, - zip_safe=False, -) \ No newline at end of file