From 258cd389c7b34a8abb58cc37415495f24e9866a8 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 24 Aug 2020 15:12:46 +0200 Subject: [PATCH] Add python package action. --- .github/workflows/publish-conda-package.yml | 22 --------------- .github/workflows/python-publish.yml | 31 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/publish-conda-package.yml create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/publish-conda-package.yml b/.github/workflows/publish-conda-package.yml deleted file mode 100644 index 4a81399..0000000 --- a/.github/workflows/publish-conda-package.yml +++ /dev/null @@ -1,22 +0,0 @@ -#name: 'Anaconda Github Action' - -on: [push] - -jobs: - test_job: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - pythonVersion: [3.7] - steps: - - uses: actions/checkout@v2 - - name: Anaconda-Action - id: step1 - uses: fdiblen/anaconda-action@0.1.7 - with: - envFileName: 'environment.yml' - channels: 'conda-forge pytorch' - publish: 'true' - publishChannel: 'deepspectrum' - publishToken: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..d4ba985 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/*