diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..32baacc --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +name: Build and upload releases + +on: + release: + types: [published] + +jobs: + deploy: + name: ${{ matrix.os }} ${{ matrix.python-version }} + strategy: + matrix: + os: [ubuntu-latest, macOS-latest] + python-version: ['3.8', '3.9', '3.10'] + poetry-version: [1.2] + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Run image + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: ${{ matrix.poetry-version }} + - name: Install package + run: poetry install + - name: Build and publish package + run: poetry publish --build --skip-existing --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/docs/source/development.rst b/docs/source/development.rst index cccad68..41c6fe0 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -295,24 +295,10 @@ Release Process 3. Create a new release on Github of the `main` branch of the form ``vX.Y.Z`` (where ``X``, ``Y``, and ``Z`` refer to the new version). Add a description of the new feature or bugfix. For details on the version number see - Versioning_ below. + Versioning_ below. This will trigger a Action to automatically build and + upload the release to PyPI -4. Pull the repository and checkout the tag and create the distribution files - using: - -.. code:: bash - - git pull - git checkout vX.Y.Z - poetry build - -5. (maintainers only) Publish the builds to PyPI. - -.. code:: bash - - poetry publish - -7. (maintainers only) Check if the new version is on pypi (https://pypi.python.org/pypi/pyndl/). +4. Check if the new version is on pypi (https://pypi.python.org/pypi/pyndl/). Versioning diff --git a/pyproject.toml b/pyproject.toml index da5ec07..b303c34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyndl" -version = "1.0.0" +version = "1.0.1" description = "Naive discriminative learning implements learning and classification models based on the Rescorla-Wagner equations." license = "MIT"