Skip to content

Commit

Permalink
add trusted publishing yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Nov 7, 2024
1 parent 863497f commit 99f1ab6
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9.16, 3.10.9, 3.11.5, 3.12, 3.13]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.30"

- name: Set up Python
run: uv python install 3.13

- name: Install the project
run: uv sync --all-extras --dev

- name: Tests
run: make test

deploy:
runs-on: ubuntu-latest
needs: [test]
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "0.4.30"

- name: Set up Python
run: uv python install 3.13

- name: Build
run: uv build

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

0 comments on commit 99f1ab6

Please sign in to comment.