Skip to content

CI: Publish PyPI releases using GitHub Actions workflows #1

CI: Publish PyPI releases using GitHub Actions workflows

CI: Publish PyPI releases using GitHub Actions workflows #1

Workflow file for this run

---
name: Publish
on: push # yamllint disable-line rule:truthy
jobs:
build:
name: Build distribution package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: python -m pip install --user build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish distribution package to TestPyPI
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/yamllint
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/