Skip to content

Commit

Permalink
feat: added automatic release for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
matq007 committed Sep 12, 2024
1 parent c3863a4 commit 1bfdd4a
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@main

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v2
with:
version: "latest"
enable-cache: true

- name: Install Python
run: uv python install

- name: Install pypa/build
run: uv build

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish to pypi
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/scanvi-explainer
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 1bfdd4a

Please sign in to comment.