Skip to content

Commit

Permalink
add pypi publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
rpreen committed Jul 29, 2024
1 parent d8a1096 commit 3938acc
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: PyPI Publish

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: pipx run build

- uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/*

upload:
runs-on: ubuntu-latest
# if: github.event_name == 'release' && github.event.action == 'published'

needs: [build]

environment:
name: pypi
url: https://pypi.org/p/acro

permissions:
id-token: write
contents: read
attestations: write

steps:
- uses: actions/download-artifact@v4
with:
pattern: build-*
path: dist
merge-multiple: true

- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: "dist/*"

- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
# repository-url: https://test.pypi.org/legacy/
...

0 comments on commit 3938acc

Please sign in to comment.