-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/jozu-ai/pykitops
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build and Deploy Package and Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
# Set up Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
# Install dependencies | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch twine mkdocs mkdocs-material bump2version | ||
# Bump version | ||
- name: Bump version and push tag | ||
run: | | ||
bump2version patch # You can specify 'patch', 'minor', or 'major' based on your versioning needs | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Build the package distributables and publish to PyPI | ||
- name: Build package | ||
run: | | ||
hatch build | ||
- name: Publish package to PyPI | ||
run: twine upload dist/* | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
# Build and deploy mkdocs to GitHub Pages | ||
- name: Build and deploy mkdocs | ||
run: | | ||
mkdocs build | ||
mkdocs gh-deploy --force |