Skip to content

Build and Publish DraftGPT Package #3

Build and Publish DraftGPT Package

Build and Publish DraftGPT Package #3

Workflow file for this run

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 }}