Skip to content

Commit

Permalink
Merge pull request #2 from shenanigansd/patch-1
Browse files Browse the repository at this point in the history
Add workflow for Trusted Publishing
  • Loading branch information
AdamPSU authored Sep 1, 2024
2 parents 651e649 + 8afc9ec commit e79955f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/python-publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Python 🐍 distributions 📦 to PyPI

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

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

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

- name: Build and inspect Python 🐍 package 📦
uses: hynek/build-and-inspect-python-package@2dbbf2b252d3a3c7cec7a810e3ed5983bd17b13a # v2.8.0
with:
attest-build-provenance-github: ${{ github.event.action == 'published' }}

publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
needs: build
if: ${{ github.event.action == 'published' }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/kavian/${{ github.ref_name }}
permissions:
id-token: write

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

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
with:
verbose: true
print-hash: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Kavian

0 comments on commit e79955f

Please sign in to comment.