Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/python.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: DomainTools python wrapper CI/CD

on:
push:
pull_request:
release:
types: [published]


jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
run: |
export TOX_SKIP_MISSING_INTERPRETERS="False";
tox -e py

# run only in main and in pull request to `main` and in publish release
release-build:
if: |
github.ref == 'refs/heads/main' ||
(github.event_name == 'pull_request' && github.base_ref == 'main') ||
(github.event_name == 'release' && github.event.action == 'published')
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build package
run: python -m build

- name: Upload distributions as artifact
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

publish-to-pypi:
runs-on: ubuntu-latest
needs: release-build
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write # Required for OIDC trusted publishing
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish to PyPI using API token
uses: pypa/gh-action-pypi-publish@release/v1
Loading