Skip to content

Merge pull request #183 from CyberAgentAILab/bump-to-v0.11.0 #12

Merge pull request #183 from CyberAgentAILab/bump-to-v0.11.0

Merge pull request #183 from CyberAgentAILab/bump-to-v0.11.0 #12

Workflow file for this run

name: Publish distributions to TestPyPI and PyPI
on:
push:
tags:
- v*.*.*
jobs:
build-n-publish:
name: Build and publish Python distributions to TestPyPI and PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off twine wheel build
- name: Build distribution packages
run: python -m build --sdist --wheel
- name: Verify the distributions
run: twine check dist/*
- uses: actions/upload-artifact@v2
with:
name: distribution
path: dist/
- name: Publish distribution to Test PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAGNAME=$(jq --raw-output .ref "$GITHUB_EVENT_PATH" | sed -e "s/refs\/tags\///")
gh release create ${TAGNAME} --draft dist/*