Skip to content

Commit

Permalink
Merge pull request #12 from zpieslak/9-add-workflow-that-automates-pu…
Browse files Browse the repository at this point in the history
…blishing-to-pypi

Add publish workflow
  • Loading branch information
zpieslak authored Sep 29, 2024
2 parents 1114b2a + a2a4991 commit 9fedac6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish

on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
34 changes: 16 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,26 @@ on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e .[test]
- name: Lint with flake8
run: flake8 . --count --statistics
- name: Lint with mypy
run: mypy .
- name: Test
run: coverage run -m unittest -v
- name: Verify coverage
run: coverage report --fail-under=95
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[test]"
- name: Lint with flake8
run: flake8 . --count --statistics
- name: Lint with mypy
run: mypy .
- name: Test
run: coverage run -m unittest -v
- name: Verify coverage
run: coverage report --fail-under=95

0 comments on commit 9fedac6

Please sign in to comment.