Skip to content

Commit

Permalink
feat: add publish
Browse files Browse the repository at this point in the history
  • Loading branch information
hhk7734 committed Aug 26, 2023
1 parent d60c12a commit 8da84a5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Upload lexorank-py to PyPI

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

concurrency:
group: publish-lexorank-py
cancel-in-progress: true

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install poetry
run: pipx install poetry

- name: Set Poetry environment
run: poetry env use 3.10

- name: Install dependencies
run: make install_publish

- name: Build and Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: make publish
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ remove_local:

.PHONY: install_test
install_test:
poetry install --no-root --without dev
poetry install --no-root --without dev,publish

.PHONY: install_publish
install_test:
poetry install --no-root --without dev,test

.PHONY: test
test:
poetry run pytest -s
poetry run pytest -s

.PHONY: publish
publish:
poetry run python -m build
poetry run twine upload dist/*
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ mypy = "^1.4.1"
black = "^23.7.0"
isort = "^5.12.0"
pylint = "^2.17.4"
build = "^0.10.0"
twine = "^4.0.2"
ipython = "^8.14.0"


[tool.poetry.group.test.dependencies]
pytest = "^7.4.0"


[tool.poetry.group.publish.dependencies]
build = "^0.10.0"
twine = "^4.0.2"

[tool.black]
exclude = '''
/(
Expand Down

0 comments on commit 8da84a5

Please sign in to comment.