diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e7f600f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +# publishes to pypi based on git releases. NOTE: The git tag is used to trigger the +# workflow and should be the same as the version number in the pyproject.toml file. +name: Publish to PyPI +on: + tags: # run on tags starting with a v character. ex. v1.0.0 + - v* +jobs: + test: + uses: ./.github/workflows/test.yml + publish: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install poetry + run: pipx install poetry + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + cache: 'poetry' + - name: Install dependencies + run: poetry install + - name: build and publish to pypi + run : poetry publish --build --username $PYPI_USERNAME --password $PYPI_TOKEN + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4640e96..ac80941 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,7 @@ on: - main pull_request: workflow_dispatch: + workflow_call: jobs: lint: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..67bc43c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,55 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Changed +- improved the documentation. +- Added github action to release the package. + +## [1.0.9] - 2022-11-01 +### Added +- Python 3.11 support. +- Package version now available via `__version__` attribute. + +### Changed +- Project is now built with [Poetry](https://python-poetry.org). +- Moved information of python version to the class initialization. +- Lint codebase using black. + +## [1.0.8] - 2022-04-26 +### Fixed +- Fixed a bug with optional `job_type` parameter for job status endpoint. + +## [1.0.7] - 2022-04-26 +### Changed +- Do not require `job_type` to be set for job status endpoint. + +## [1.0.6] - 2022-04-25 +### Added +- Added support for image files ending with `.jpeg`. + +### Changed +- make `return_images` and `return_history` optional arguments for job status endpoint. + +## [1.0.5] - 2022-02-28 +### Added +- Added support for Document Verification job type. + +## [1.0.4] - 2022-02-07 +## [1.0.3] - 2021-11-10 +## [1.0.2] - 2021-11-02 +## [1.0.1] - 2021-10-04 +## [1.0.0] - 2021-09-13 + +## [0.0.13] - 2020-09-16 +### Added + - Created changelog. + - Fixed job status error string format. + - Added black for code formatting. + - Fixed python semantics. + - Moved zipfile out from webapi class. + +## [0.0.12] - 2022-08-19 \ No newline at end of file diff --git a/README.md b/README.md index 8f3ca50..503fb30 100644 --- a/README.md +++ b/README.md @@ -580,18 +580,17 @@ If you are outside the virtual environment, run `poetry run pytest` from the roo To release a new version: -- Bump the version number in `pyproject.toml` (the version in `smile_id_core/__init__.py` will pick this up) -- Update `changelog.md` with the new version number and the changes made -- Run `poetry build` to build package. -- Ensure your PyPI credentials are propery configured -- Run `poetry publish` to publish package. +- Bump the version number in `pyproject.toml` (the version in `smile_id_core/__init__.py` will pick this up). +- Update `CHANGELOG.md` with the new version number and the changes made. +- Submit a pull request to the `main` branch. Merge the PR after it has been approved. +- Create a git tag for the new version. The tag should be the same as the version number in `pyproject.toml`. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/smileidentity/smile-identity-core-python-3 -Please format the code with [black](https://github.com/psf/black) prior to submitting pull requests, by running: -``` +Please format the code with [black](https://github.com/psf/black) prior to submitting pull requests by running the following command from the project's root: + +```bash poetry run black . ``` -from the project's root. diff --git a/changelog.md b/changelog.md deleted file mode 100644 index 2f1d883..0000000 --- a/changelog.md +++ /dev/null @@ -1,19 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -## [1.0.9] - 2022-11-01 - -### Added -- Python 3.11 support - -### Changed -- Project is now built with [Poetry](https://python-poetry.org) -- Moved information of python version to the class initialization - -## [0.0.13] - 2020-09-16 -### Added - * Created changelog - * Fixed job status error string format - * Added black for code formatting - * Fixed python semantics - * Moved zipfile out from webapi class