Skip to content

build(deps): Bump actions/attest-build-provenance from 1.3.1 to 1.3.2 in the actions group #54

build(deps): Bump actions/attest-build-provenance from 1.3.1 to 1.3.2 in the actions group

build(deps): Bump actions/attest-build-provenance from 1.3.1 to 1.3.2 in the actions group #54

Workflow file for this run

name: publish distributions
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
workflow_dispatch:
inputs:
publish:
type: choice
description: 'Publish to TestPyPI?'
options:
- false
- true
permissions:
contents: read
jobs:
build-and-publish:
name: Build and publish Python distro to (Test)PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install python-build, check-manifest, and twine
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install build check-manifest twine
python -m pip list
- name: Check MANIFEST
run: |
check-manifest
- name: Build a sdist and a wheel
run: |
python -m build .
- name: Generate artifact attestation for sdist and wheel
# If publishing to PyPI
if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'yadage/yadage-schemas'
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "dist/yadage_schemas-*"
- name: Verify the distribution
run: twine check dist/*
- name: List contents of sdist
run: python -m tarfile --list dist/yadage_schemas-*.tar.gz
- name: List contents of wheel
run: python -m zipfile --list dist/yadage_schemas-*.whl
- name: Publish distribution 📦 to Test PyPI
# Publish to TestPyPI on tag events of if manually triggered
# Compare to 'true' string as booleans get turned into strings in the console
if: >-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'yadage/yadage-schemas')
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && github.repository == 'yadage/yadage-schemas')
uses: pypa/[email protected]
with:
password: ${{ secrets.test_pypi_api_token }}
repository_url: https://test.pypi.org/legacy/
print-hash: true
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'yadage/yadage-schemas'
uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_api_token }}
print-hash: true