53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Create Release and Publish to PyPI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
confirm:
|
|
description: 'Type "publish" to confirm release'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: read
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Need full history for git operations
|
|
|
|
- name: Validate confirmation
|
|
run: |
|
|
if [ "${{ github.event.inputs.confirm }}" != "publish" ]; then
|
|
echo "❌ Must type 'publish' to confirm release"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install --upgrade uv twine toml requests
|
|
uv pip install --system -e . --no-deps
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "GitHub Actions"
|
|
git config --global user.email "actions@github.com"
|
|
|
|
- name: Run release script
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
run: |
|
|
python -m mflux.release.release_script
|