Skip to content

Commit

Permalink
Update pipelines (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Sep 21, 2024
1 parent c664cef commit 0defda6
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 33 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy Documentation

on:
push:
tags:
- "**"

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.4.12"
enable-cache: true

- name: Set up Python
run: uv python install 3.12

- name: Install dependencies
run: uv sync --frozen

- run: uv run mkdocs gh-deploy --force
79 changes: 46 additions & 33 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,59 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Publish Python Package

on:
push:
tags:
- '*'

permissions:
contents: read
- "**"

jobs:
deploy:
build:
runs-on: ubuntu-latest

outputs:
version: ${{ steps.inspect_package.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.4.12"
enable-cache: true

- name: Set up Python
run: uv python install 3.12

- name: Build package
run: uv build

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install -e '.[docs]'
- name: Inspect package version
id: inspect_package
run: |
version=$(uvx hatchling version)
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Build package
run: python -m build
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: package-distributions
path: dist/

- name: Publish package
uses: pypa/[email protected]
pypi-publish:
runs-on: ubuntu-latest
needs: build

permissions:
id-token: write

environment:
name: pypi
url: https://pypi.org/project/python-multipart/${{ needs.build.outputs.version }}

steps:
- name: Download package
uses: actions/download-artifact@v4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish docs
run: mkdocs gh-deploy --force
name: package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
multipart.fastapiexpert.com

0 comments on commit 0defda6

Please sign in to comment.