diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 98243da..c66f617 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -43,7 +43,7 @@ jobs: publish: needs: check-version-changed - if: needs.check-version-changed.outputs.version_changed == 'true' + if: needs.check-version-changed.outputs.version_changed == 'true' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Check out code @@ -63,3 +63,31 @@ jobs: run: | python setup.py sdist bdist_wheel twine upload dist/* + + publish-dev: + needs: check-version-changed + if: needs.check-version-changed.outputs.version_changed == 'true' && github.ref == 'refs/heads/develop' + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Get version + id: get_version + run: | + echo "VERSION=$(python setup.py --version)" >> $GITHUB_OUTPUT + - name: Build and publish dev version + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + VERSION="${{ steps.get_version.outputs.VERSION }}-dev" + python setup.py sdist bdist_wheel + twine upload --repository-url https://test.pypi.org/legacy/ dist/*$VERSION* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7aa0495..5810d04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: release: needs: check-version-changed - if: needs.check-version-changed.outputs.version_changed == 'true' + if: needs.check-version-changed.outputs.version_changed == 'true' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Checkout Repository diff --git a/setup.py b/setup.py index 924887e..a6eb256 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='neuralnetlib', - version='2.4.0', + version='2.4.1', author='Marc Pinet', description='A simple convolutional neural network library with only numpy as dependency', long_description=open('README.md', encoding="utf-8").read(),