Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hynek's build-and-inspect-python-package to build the package #5

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 21 additions & 32 deletions .github/workflows/python-publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
name: "Publish Python 🐍 distributions 📦 to PyPI"
name: Publish Python 🐍 distributions 📦 to PyPI

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
types:
- published

jobs:
build:
name: "Build distribution 📦"
name: Build distribution 📦
runs-on: ubuntu-latest
permissions:
attestations: write

steps:
- name: "Checkout repository"
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: "Set up Python 3.x"
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: "Install pypa/build"
run: >-
python -m
pip install
build
--user

- name: "Build a binary wheel and a source tarball"
run: >-
python -m
build
--outdir dist/

- name: "Upload packages"
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
- name: Build and inspect Python 🐍 package 📦
uses: hynek/build-and-inspect-python-package@2dbbf2b252d3a3c7cec7a810e3ed5983bd17b13a # v2.8.0
with:
name: python-package-distributions
path: dist/
attest-build-provenance-github: ${{ startswith(github.event.ref, 'refs/tags/') }}

publish-to-pypi:
name: "Publish Python 🐍 distribution 📦 to PyPI"
name: Publish Python 🐍 distribution 📦 to PyPI
needs: build
if: ${{ startswith(github.event.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
environment:
name: pypi
Expand All @@ -50,13 +39,13 @@ jobs:
id-token: write

steps:
- name: "Download dists"
- name: Download dists
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: python-package-distributions
name: Packages
path: dist/

- name: "Publish distribution 📦 to PyPI"
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
with:
verbose: true
Expand Down
5 changes: 4 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog
=========

- :release:`0.1.0 <13th August 2024>`
- :release:`0.1.1 <12th August 2024>`
- :support:`6` Enable build attestations

- :release:`0.1.0 <12th August 2024>`
- :feature:`1` Initialize package
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "crazylibs"
version = "0.1.0"
version = "0.1.1"
description = "crazylibs"
readme = "README.md"
authors = [{ name = "Bradley Reynolds", email = "[email protected]" }]
Expand Down
Loading