Skip to content

Commit

Permalink
Action to automatically publish new version on PyPI (#89)
Browse files Browse the repository at this point in the history
* Action to automatically publish new version on PyPI

* Use env field

* Set token in config
  • Loading branch information
KapJI authored Apr 19, 2021
1 parent 90aff5d commit b3278f5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
publish:
name: Publish
strategy:
matrix:
python-version: [3.8]
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.5

- name: Install dependencies
run: poetry install

- name: Set version
run: poetry version $(git describe --tags --abbrev=0 | sed -e "s/^v//")

- name: Build package
run: poetry build

- name: Publish to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "glocaltokens"
version = "0.3.1"
version = "0.0.0"
authors = ["Ilja Leiko <[email protected]>"]
classifiers = [
"Development Status :: 3 - Alpha",
Expand Down

0 comments on commit b3278f5

Please sign in to comment.