Skip to content

Commit

Permalink
Add release pipeline (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanjmcdougall authored Oct 29, 2024
1 parent d6a24c7 commit f27d232
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: CI
on:
workflow_dispatch:
push:
branches: ['main']
pull_request:
workflow_dispatch:
push:
branches: ['main']
pull_request:
jobs:
tests:
runs-on: ${{ matrix.os }}
env:
PYTHONIOENCODING: utf-8
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup git user config
run: |
git config --global user.name placeholder
git config --global user.email [email protected]
- name: "Set up uv"
uses: astral-sh/setup-uv@f3bcaebff5eace81a1c062af9f9011aae482ca9d # v3.1.7
- name: Set up uv
uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
with:
version: "latest"

- name: "Set up Python"
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -39,8 +39,7 @@ jobs:
- name: Run pytest
uses: pavelzw/pytest-action@510c5e90c360a185039bea56ce8b3e7e51a16507 # v2.2.0
with:
custom-arguments: tests

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

name: Release to PyPI
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up uv
uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
with:
version: "latest"

- name: "Set up Python"
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.12

- name: Release
run: |
uv build
uv publish --trusted-publishing always

0 comments on commit f27d232

Please sign in to comment.