Skip to content

Commit

Permalink
Add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timofurrer committed Oct 9, 2023
1 parent d622397 commit 5495e79
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 9 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
run: |
python -m pip install --upgrade black flake8
- name: black format check
run: black --check --line-length 120 pandoc_plantuml_filter.py tests setup.py
run: python -m black --check --line-length 120 pandoc_plantuml_filter.py tests
- name: flake8 format check
run: flake8 --max-line-length 120 pandoc_plantuml_filter.py tests setup.py
run: python -m flake8 --max-line-length 120 pandoc_plantuml_filter.py tests
test:
strategy:
fail-fast: false
Expand All @@ -32,13 +32,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Setup build and test environment
run: python -m pip install --upgrade pip setuptools wheel pytest pytest-mock
- name: Setup package
run: python -m pip install .
run: python -m pip install --upgrade pip build pytest pytest-mock
- name: Build package
run: python -m build
- name: Install package
run: python -m pip install --pre dist/pandoc_plantuml_filter-*.whl
- name: run unit tests
run: pytest tests/test_unit.py
run: python -m pytest tests/test_unit.py
- name: install dependencies for integration tests
run: sudo apt update && sudo apt install -y pandoc plantuml
- name: run integration tests
run: pytest tests/test_integration.py
run: python -m pytest tests/test_integration.py

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ missfont.log
pandoc_plantuml_filter.egg-info/
plantuml-images/
sample.pdf
dist/

0 comments on commit 5495e79

Please sign in to comment.