Skip to content

Commit

Permalink
Version情報をGitHubから取得して、PyPIへ自動でpublishするように変更した (#585)
Browse files Browse the repository at this point in the history
* versionを動的に生成する

* pypiへ自動的にアップロードする

* 不要なメタタグを消す

* update python
  • Loading branch information
yuji38kwmt committed May 8, 2023
1 parent a78179f commit c31fc3c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Python 🐍 distributions 📦 to PyPI

on:
release:
types: [published]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install poetry
run: |
python -m pip install "poetry<1.5" poetry-dynamic-versioning
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
2 changes: 1 addition & 1 deletion annofabapi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.68.0"
__version__ = "0.0.0" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
20 changes: 9 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
[tool.poetry]
name = "annofabapi"
version = "0.68.0"
version = "0.0.0" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
description = "Python Clinet Library of Annofab WebAPI (https://annofab.com/docs/api/)"
authors = ["yuji38kwmt"]
authors = ["Kurusugawa Computer Inc."]
license = "MIT"
keywords=["annofab", "api"]
readme="README.md"
repository="https://github.com/kurusugawa-computer/annofab-api-python-client"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Utilities",
"Operating System :: OS Independent",
]
Expand Down Expand Up @@ -79,7 +72,12 @@ ignore_missing_imports = true
# 型ヒントが付いていない関数もチェックする
check_untyped_defs = true

[tool.poetry-dynamic-versioning]
enable = true
format = "{base}"


[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

0 comments on commit c31fc3c

Please sign in to comment.