Skip to content

Commit

Permalink
Publish to pypi based on git tag (#15)
Browse files Browse the repository at this point in the history
* add a github action to publish based on git tags

* update changelog and readme
  • Loading branch information
mldangelo authored Nov 1, 2022
1 parent 88aea5a commit 42880c0
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 27 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- main
pull_request:
workflow_dispatch:
workflow_call:
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
19 changes: 0 additions & 19 deletions changelog.md

This file was deleted.

0 comments on commit 42880c0

Please sign in to comment.