Skip to content

Merge branch 'master' of github.com:pamoller/xmlformatter #27

Merge branch 'master' of github.com:pamoller/xmlformatter

Merge branch 'master' of github.com:pamoller/xmlformatter #27

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Publish xmllformatter on PyPi
on:
push:
branches: [ "master" ]
tags:
- v*
permissions:
contents: read
jobs:
build:
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: >-
python3 -m
pip install
build
--user
- name: Test with pytest
run: >-
cd test && python3 test_xmlformatter.py
- 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:
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
name: Publish Python 🐍 distribution 📦 to PyPI ${{ github.ref }}
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/xmlformatter
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4.1.7
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1