Improve filtering out of false endpoints. (#49) #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Check versions are in sync | |
shell: bash | |
run: | | |
init_version=$(head -n 4 atom_tools/__init__.py | tail -1 | cut -d"'" -f2) | |
toml_version=$(head -n 3 pyproject.toml | tail -1 | cut -d'"' -f2) | |
if [ "$init_version" != "$toml_version" ]; then | |
echo "Version in atom_tools.__init__.py does not match pyproject.toml." | |
exit 1 | |
else | |
echo "Version in atom_tools.__init__.py matches pyproject.toml." | |
fi | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install setuptools build | |
- name: Build | |
run: | | |
python3 -m build | |
- name: Publish package distributions to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: pypa/gh-action-pypi-publish@release/v1 |