Skip to content

3.4.3

3.4.3 #17

Workflow file for this run

# This workflow will upload a Python Package using Trusted Publishers automatically when a release is created and the deployment is approved by an admin
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# and https://docs.pypi.org/trusted-publishers/using-a-publisher/.
name: Upload Python Package
on:
release:
types: [published]
jobs:
release-build:
runs-on: ubuntu-latest
permissions:
contents: read
attestations: write # to upload assets attestation of 'dists' for build provenance
id-token: write # grant additional permission to attestation action to mint the OIDC token permission
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.9'
- name: Install sphinx toolset
run:
python -m pip install sphinx sphinx-argparse --user
- name: Install tldr dependencies
run:
python -m pip install -r requirements.txt --user
- name: Generate the manpage
working-directory: docs
run: make man
- name: Install build
run:
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build
--sdist
--wheel
--outdir dist/
.
- name: Attest generated files
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-path: dist/
- name: Upload release distributions
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: release-dists
path: dist/
pypi-publish:
runs-on: ubuntu-latest
if: github.repository == 'tldr-pages/tldr-python-client'
needs: ['release-build']
environment:
name: pypi
url: https://pypi.org/project/tldr/
permissions:
id-token: write # Required for accessing OpenID Connect (OIDC) token for PyPI trusted publisher
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: release-dists
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0