Skip to content

Commit

Permalink
Merge pull request #2374 from jemrobinson/automate-pypi-release
Browse files Browse the repository at this point in the history
Create GitHub Action to upload to PyPI on release
  • Loading branch information
jemrobinson authored Jan 23, 2025
2 parents 26eaca0 + 38c0d84 commit eea66bd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Upload to PyPI

# Run workflow on pushes to matching branches
on: # yamllint disable-line rule:truthy
workflow_dispatch:
release:
types: [published]

jobs:
build-and-publish-to-pypi:
name: Build distribution and publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/data-safe-haven/
permissions:
id-token: write # needed for trusted publishing
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install hatch
run: pip install hatch

- name: Build with hatch
run: hatch build

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit eea66bd

Please sign in to comment.