From b74cf1763541766832800119b2bbea1b4cdbfe6c Mon Sep 17 00:00:00 2001 From: Andrew Beveridge Date: Sat, 23 Dec 2023 17:17:38 -0600 Subject: [PATCH] Initial attempt at configuring conda package --- .github/workflows/publish-to-conda.yml | 27 +++++++++++++++ .../{publish.yml => publish-to-docker.yml} | 21 +++--------- .github/workflows/publish-to-pypi.yml | 19 +++++++++++ conda/meta.yaml | 34 +++++++++++++++++++ environment.yaml | 17 ++++++++++ 5 files changed, 101 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/publish-to-conda.yml rename .github/workflows/{publish.yml => publish-to-docker.yml} (77%) create mode 100644 .github/workflows/publish-to-pypi.yml create mode 100644 conda/meta.yaml create mode 100644 environment.yaml diff --git a/.github/workflows/publish-to-conda.yml b/.github/workflows/publish-to-conda.yml new file mode 100644 index 0000000..1790494 --- /dev/null +++ b/.github/workflows/publish-to-conda.yml @@ -0,0 +1,27 @@ +name: publish-to-conda + +on: + release: + types: [published] + +jobs: + setup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setting up anaconda for channels + uses: s-weigand/setup-conda@v1 + with: + update-conda: true + conda-channels: anaconda, conda-forge + publish: + runs-on: ubuntu-latest + needs: setup + steps: + - uses: actions/checkout@v4 + - name: Publish to anaconda.org + uses: fcakyon/conda-publish-action@v1.3 + with: + subdir: 'conda' + anacondatoken: ${{ secrets.ANACONDA_TOKEN }} + platforms: 'win osx linux' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish-to-docker.yml similarity index 77% rename from .github/workflows/publish.yml rename to .github/workflows/publish-to-docker.yml index 9a39340..6201f29 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish-to-docker.yml @@ -1,23 +1,10 @@ -name: Auto-publish +name: publish-to-docker -on: [push, workflow_dispatch] +on: + release: + types: [published] jobs: - # Auto-publish when version is increased - publish-pypi: - # Only publish on `main` branch - if: github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - permissions: # Don't forget permissions - contents: write - - steps: - - uses: etils-actions/pypi-auto-publish@v1 - with: - pypi-token: ${{ secrets.PYPI_API_TOKEN }} - gh-token: ${{ secrets.GITHUB_TOKEN }} - parse-changelog: false - build-and-push-docker: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..156dc06 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,19 @@ +name: publish-to-pypi + +on: [push, workflow_dispatch] + +jobs: + # Auto-publish when version is increased + publish-pypi: + # Only publish on `main` branch + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: # Don't forget permissions + contents: write + + steps: + - uses: etils-actions/pypi-auto-publish@v1 + with: + pypi-token: ${{ secrets.PYPI_API_TOKEN }} + gh-token: ${{ secrets.GITHUB_TOKEN }} + parse-changelog: false diff --git a/conda/meta.yaml b/conda/meta.yaml new file mode 100644 index 0000000..e487fbd --- /dev/null +++ b/conda/meta.yaml @@ -0,0 +1,34 @@ +{% set name = "audio-separator" %} +{% set version = "0.9.6"%} + +package: + name: "{{ name|lower }}" + version: "{{ version }}" + +source: + path: .. + +build: + number: 0 + script: "{{ PYTHON }} -m pip install . -vv" + +requirements: + host: + - python>=3.9 + - pip + run: + - python>=3.9 + +about: + home: "https://github.com/karaokenerds/python-audio-separator" + license: "MIT" + license_family: MIT + summary: "Easy to use vocal separation on CLI or as a python package, using the amazing MDX-Net models from UVR." + description: | + Audio Separator is a Python package that allows you to separate an audio file into two stems, primary and secondary, using a model in the ONNX format trained by @Anjok07 for use with UVR (https://github.com/Anjok07/ultimatevocalremovergui). + doc_url: "https://github.com/karaokenerds/python-audio-separator" + dev_url: "https://github.com/karaokenerds/python-audio-separator" + +extra: + recipe-maintainers: + - 757713 diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 0000000..d8fcf1e --- /dev/null +++ b/environment.yaml @@ -0,0 +1,17 @@ +name: audio-separator +channels: + - pytorch + - conda-forge + # We want to have a reproducible setup, so we don't want default channels, + # which may be different for different users. All required channels should + # be listed explicitly here. + - nodefaults +dependencies: + - python >=3.9 + - mamba + - pip # pip must be mentioned explicitly, or conda-lock will fail + - poetry + - pytorch + - torchaudio + - onnxruntime + - ffmpeg