diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7b811cb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b71b164..e6a1227 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index 232ee03..e7545c3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ missfont.log pandoc_plantuml_filter.egg-info/ plantuml-images/ sample.pdf +dist/