Skip to content

Commit

Permalink
Merge pull request #35 from marcpinet/develop
Browse files Browse the repository at this point in the history
feat: add version management for both main and develop
  • Loading branch information
marcpinet authored Apr 24, 2024
2 parents 4869496 + 017465c commit dece1cf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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*
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit dece1cf

Please sign in to comment.