Build and Publish DraftGPT Package #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish DraftGPT Package | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine bump2version | |
- name: Bump version | |
id: bump_version | |
run: | | |
bump2version patch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build package | |
run: | | |
python -m pip install --upgrade build | |
python -m build | |
- name: Verify build | |
run: | | |
ls dist/ | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: twine upload dist/* | |
- name: Create GitHub release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.bump_version.outputs.new_version }} | |
release_name: Release ${{ steps.bump_version.outputs.new_version }} | |
body: | | |
Release notes for version ${{ steps.bump_version.outputs.new_version }} | |