Skip to content

Commit

Permalink
publish to pypi with github-ci with auto-bumping version yashaka#246
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-kotlyar committed Apr 24, 2021
1 parent 1e0fced commit 49950f3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,29 @@
name: Upload Python Package
on:
release:
types: [ published ]

jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: abatilo/actions-poetry@v2.1.0

- name: Bump version
run: |
version=${{ github.event.release.tag_name }}
poetry version $version
sed -i "s/__version__ = .*/__version__ = \'${version}\'/g" ./selene/__init__.py
- name: Commit version
uses: EndBug/add-and-commit@v7.1.2
with:
add: '["pyproject.toml", "selene/__init__.py"]'
branch: 'master'
message: 'bump version up to ${{ github.event.release.tag_name }}'

- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.5
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
7 changes: 6 additions & 1 deletion CHANGELOG.md
Expand Up @@ -77,7 +77,12 @@
- repeat fix of #225 to other options in shared config, refactor it...
- should we make original config (not shared) mutable?

## 2.0.0a36 (to be released on 30.03.2021)
## 2.0.0a37 (released on 24.04.2021)
- Update webdriver-manager to version 3.3.0 [#299](https://github.com/yashaka/selene/issues/299)
- New release and publish process of selene [#246](https://github.com/yashaka/selene/issues/246#issuecomment-825897200)

## 2.0.0a36 (released on 30.03.2021)
Contributors release.
- Moved selene from Pipenv to [Poetry](https://python-poetry.org/) as a greater python dependency resolver of 2021 (see #302).
- Moved to a new release process with Poetry: added bash aliases in `./.run/*.sh` (see #304).
- Moved from setup.py and setup.cfg to pyproject.toml config-file.
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -42,3 +42,12 @@ Code-style is controlled by few linter jobs in GitHub Actions.

### Black
- lints default black rules except "string normalization".

# Release process
1. Create new release on GitHub.
2. Choose new tag or take not released yet.
3. Describe release notes.
4. Select pre-release checkbox if not stable.
5. Publish the release on GitHub.

Then GitHub action will automatically build and publish release to pypi with selected tag automatically. Also it will commit the tag semver into `__init__.py` and `pyproject.toml` before building if it has not been there yet.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -53,7 +53,7 @@ Tests with Selene can be built either in a simple straightforward "selenide' sty

## Versions

* Latest recommended version to use is [2.0.0a36](https://pypi.org/project/selene/2.0.0a36/)
* Latest recommended version to use is [2.0.0a37](https://pypi.org/project/selene/2.0.0a37/)
* it's a completely new version of selene, with improved API and speed
* supports python >= 3.7
* it's incompatible with [1.x](https://github.com/yashaka/selene/tree/1.x)
Expand Down

0 comments on commit 49950f3

Please sign in to comment.