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: Build and publish Python wheel and sdist | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
name: Build source distribution and wheel | |
runs-on: ubuntu-latest | |
services: | |
lakefs: # required for building documentation | |
image: treeverse/lakefs:latest | |
ports: | |
- 8000:8000 | |
env: | |
LAKEFS_INSTALLATION_USER_NAME: "quickstart" | |
LAKEFS_INSTALLATION_ACCESS_KEY_ID: "AKIAIOSFOLQUICKSTART" | |
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | |
LAKEFS_DATABASE_TYPE: "local" | |
LAKEFS_AUTH_ENCRYPT_SECRET_KEY: "THIS_MUST_BE_CHANGED_IN_PRODUCTION" | |
LAKEFS_BLOCKSTORE_TYPE: "local" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # for documentation builds | |
- name: Set up Python and dependencies | |
uses: ./.github/actions/python-deps | |
with: | |
pythonVersion: 3.11 | |
- name: Build and check | |
run: | | |
python -m build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish documentation | |
uses: ./.github/actions/mike-docs | |
with: | |
version: ${{ github.event.release.tag_name }} | |
alias: latest | |
push: true | |
publish_pypi: | |
name: Publish wheels to PyPI | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true # tolerate release package file duplicates | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |