mirror of
https://github.com/status-im/status-python-sdk.git
synced 2026-08-30 05:31:11 +00:00
69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
name: Publish Python package
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: "Git ref (branch, tag or SHA) to build from"
|
|
type: string
|
|
default: ""
|
|
|
|
jobs:
|
|
build:
|
|
name: Build distribution
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.ref || github.ref }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install build tools
|
|
run: python -m pip install --upgrade build twine
|
|
|
|
- name: Build package
|
|
run: python -m build
|
|
|
|
- name: Validate metadata
|
|
run: twine check --strict dist/*
|
|
|
|
- name: List distributions
|
|
run: ls -lh dist/
|
|
|
|
- name: Upload distributions
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: python-package-distributions
|
|
path: dist/
|
|
|
|
publish:
|
|
name: Publish to PyPI
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
environment:
|
|
name: pypi
|
|
url: https://pypi.org/project/status-sdk/
|
|
|
|
steps:
|
|
- name: Download distributions
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: python-package-distributions
|
|
path: dist/
|
|
|
|
- name: Publish package
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
attestations: false
|