Skip to content

Commit

Permalink
chore: add release job
Browse files Browse the repository at this point in the history
  • Loading branch information
LiadOz authored and loz committed Aug 28, 2024
1 parent 5bd076e commit 613091c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests

on:
push:
Expand All @@ -7,8 +7,7 @@ on:
# manually triggered

jobs:
build:

test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Python distribution to PyPI

on:
release:
types: [published]

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

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish Python distribution to PyPI
needs:
- build-distribution
runs-on: ubuntu-latest

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

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

0 comments on commit 613091c

Please sign in to comment.