3.0.0-alpha.19 #83
Workflow file for this run
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: Push to PyPI | |
on: | |
release: | |
types: [released, prereleased] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
# Mandatory for publishing with a trusted publisher | |
# c.f. https://docs.pypi.org/trusted-publishers/using-a-publisher/ | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install python-build and twine | |
run: | | |
python -m pip install --upgrade uv | |
uv pip install --system --upgrade pip | |
uv pip install --system build twine | |
uv pip list --system | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Test | |
run: | | |
echo $RELEASE_VERSION | |
echo ${{ env.RELEASE_VERSION }} | |
- name: Update Version | |
run: | | |
sed -i '/version =/ s/= "[^"][^"]*"/ = "${{ env.RELEASE_VERSION }}"/' pyproject.toml | |
- name: Build a sdist and wheel | |
run: | | |
python -m build . | |
- name: Verify the distribution | |
run: twine check --strict dist/* | |
- name: List contents of sdist | |
run: python -m tarfile --list dist/servicex-*.tar.gz | |
- name: List contents of wheel | |
run: python -m zipfile --list dist/servicex-*.whl | |
- name: Upload distribution artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-artifact | |
path: dist | |
- name: Publish distribution 📦 to PyPI | |
if: github.repository == 'ssl-hep/ServiceX_frontend' | |
uses: pypa/[email protected] | |
with: | |
print-hash: true | |
build-docs: | |
needs: | |
- publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade uv | |
uv pip install --system --upgrade pip setuptools wheel | |
uv pip install --system --upgrade '.[docs]' | |
uv pip list --system | |
- name: Build documentation | |
run: | | |
mkdir gh-pages | |
touch gh-pages/.nojekyll | |
cd docs/ | |
sphinx-build -b html . _build | |
cp -r _build/* ../gh-pages/ | |
- name: Fix permissions if needed | |
run: | | |
chmod -c -R +rX "gh-pages/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Deploy documentation | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: gh-pages |