diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7fb55a3..ade763d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -33,3 +33,31 @@ jobs: - name: Run Tests run: | pdm run pytest + + pypi-publish: + needs: ci + # Only run this job if new work is pushed to the "master" branch + if: github.event_name == 'push' && github.ref == 'refs/heads/master1' + + name: upload release to PyPI + runs-on: ubuntu-latest + permissions: + # This permission is needed for private repositories. + contents: read + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + # Dedicated environments with protections for publishing are strongly recommended. + environment: + name: pypi + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: + url: https://pypi.org/p/nvector + + steps: + - uses: actions/checkout@v4 + + - uses: pdm-project/setup-pdm@v4 + + - name: Publish release distributions to PyPI + run: pdm publish + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ac503e3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +on: + release: + types: [published] + + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + permissions: + # This permission is needed for private repositories. + contents: read + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: pdm-project/setup-pdm@v4 + + - name: Publish package distributions to PyPI + run: pdm publish \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 18fd72e..15f794d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog + +## [1.0.1] - 2024-10-03 + +### 📚 Documentation + +- Prepare changelog for automatic updates using semantic versioning + +### ⚙️ Miscellaneous Tasks + +- *(pyproject.toml)* Replace use of python-semantic-release with pdm-bump and git-cliff. + +### ◀️ Revert + +- Remove release1, pypi-publish and test-pypi-publish jobs from workflows/python-package.yml + ## [1.0.0] 2024-10-02 - Added pytest-ruff and ruff as test dependencies to pyproject.toml diff --git a/src/nvector/__init__.py b/src/nvector/__init__.py index e4dcd46..8b16aff 100644 --- a/src/nvector/__init__.py +++ b/src/nvector/__init__.py @@ -5,7 +5,7 @@ from .objects import * # noqa from ._common import use_docstring -__version__ = "1.0.0" +__version__ = "1.0.1" _PACKAGE_NAME = __name__