Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Publish to PyPI
on:
release:
types: [published]
# 手動実行はビルドと twine check の確認専用である.
# 任意の ref を選べてしまうため,アップロードは行わない.
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -31,7 +34,15 @@ jobs:
run: twine check dist/*

- name: Publish to PyPI
if: github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
run: twine upload --skip-existing dist/*

- name: Skip publish (manual run)
if: github.event_name != 'release'
run: |
echo "手動実行のためアップロードを行いませんでした."
echo "ビルド成果物は以下のとおりです."
ls -l dist