Skip to content

Merge pull request #317 from jordandeklerk/renovate/pre-commit-hooks #315

Merge pull request #317 from jordandeklerk/renovate/pre-commit-hooks

Merge pull request #317 from jordandeklerk/renovate/pre-commit-hooks #315

Workflow file for this run

name: Publish library
on:
push:
branches:
- main
tags:
# Don't try to be smart about PEP 440 compliance,
# see https://www.python.org/dev/peps/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions
- v*
jobs:
build-package:
runs-on: ubuntu-latest
permissions:
# write attestations and id-token are necessary for attest-build-provenance-github
attestations: write
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1
with:
# Prove that the packages were built in the context of this workflow.
attest-build-provenance-github: true
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# Use the `release` GitHub environment to protect the Trusted Publishing (OIDC)
# workflow by requiring signoff from a maintainer.
environment:
name: publish
url: https://pypi.org/p/moderndid
needs: build-package
permissions:
# write id-token is necessary for trusted publishing (OIDC)
id-token: write
steps:
- name: Download Distribution Artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
# The build-and-inspect-python-package action invokes upload-artifact.
# These are the correct arguments from that action.
name: Packages
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1