From 370b7b06017da35368411cf38e1a39d875a6446e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Apr 2026 17:25:26 +0000 Subject: [PATCH 1/2] feat(ci): add release-please + OIDC PyPI publishing boilerplate Wire up release-please (python release-type) for automated versioning, expand pyproject.toml with PyPI metadata and dmarcguard.io backlinks, and split CI into build/release-please/publish jobs using Trusted Publishing instead of API tokens. https://claude.ai/code/session_01URvfmnKQwhTdPXA6t3xW4v --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++------- .release-please-manifest.json | 3 ++ README.md | 25 +++++++++++- dmarcguard/__init__.py | 2 +- pyproject.toml | 59 ++++++++++++++++++++++++--- release-please-config.json | 19 +++++++++ 6 files changed, 161 insertions(+), 22 deletions(-) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9483987..03ad66d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,29 +1,74 @@ -name: CI +name: ci on: + pull_request: + branches: + - main push: branches: - main -permissions: - id-token: write - jobs: - publish: + build: runs-on: ubuntu-latest - environment: pypi + permissions: + contents: read + outputs: + artifact-name: ${{ steps.output.outputs.artifact-name }} steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-python@v6 + - name: Checkout + uses: actions/checkout@v6 + - name: Setup Python + uses: actions/setup-python@v6 with: python-version: "3.x" - - - name: Install build dependencies - run: pip install build - - - name: Build package + - name: Install build + run: python -m pip install --upgrade pip build + - name: Build sdist and wheel run: python -m build + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + if-no-files-found: error + name: dmarcguard-${{ github.run_id }}-${{ github.run_attempt }} + path: dist + - name: Output artifact name + id: output + run: | + echo "artifact-name=dmarcguard-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT" - - name: Publish to PyPI + release-please: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + outputs: + releases_created: ${{ steps.release-please.outputs.releases_created }} + tag_name: ${{ steps.release-please.outputs.tag_name }} + permissions: + contents: write + issues: write + pull-requests: write + steps: + - id: release-please + name: Release please + uses: googleapis/release-please-action@v4 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + publish: + if: needs.release-please.outputs.releases_created == 'true' + needs: [release-please, build] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/dmarcguard + permissions: + id-token: write + steps: + - name: Download build artifact + uses: actions/download-artifact@v8 + with: + name: ${{ needs.build.outputs.artifact-name }} + path: dist + - name: Publish to PyPI via Trusted Publishing (OIDC) uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..b985ff6 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} diff --git a/README.md b/README.md index d1ad13f..025e062 100644 --- a/README.md +++ b/README.md @@ -1 +1,24 @@ -# dmarcguard-sdk-python \ No newline at end of file +# dmarcguard-sdk-python + +Official Python SDK for [DMARCGuard](https://dmarcguard.io) — DMARC, SPF, and +DKIM monitoring for email deliverability and anti-spoofing. + +> [!NOTE] +> This SDK is in early development. The public API is not yet stable. + +## Installation + +```bash +pip install dmarcguard +``` + +## Links + +- Website: +- Documentation: +- Source: +- Issues: + +## License + +Licensed under the [Apache License, Version 2.0](LICENSE). diff --git a/dmarcguard/__init__.py b/dmarcguard/__init__.py index 460b3fa..eeb8f32 100644 --- a/dmarcguard/__init__.py +++ b/dmarcguard/__init__.py @@ -1,3 +1,3 @@ """Official Python SDK for DMARCGuard.""" -__version__ = "0.0.1" +__version__ = "0.0.1" # x-release-please-version diff --git a/pyproject.toml b/pyproject.toml index 20eccba..d76f785 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,19 +5,68 @@ build-backend = "hatchling.build" [project] name = "dmarcguard" version = "0.0.1" -description = "Official Python SDK for DMARCGuard" +description = "Official Python SDK for DMARCGuard — DMARC, SPF, and DKIM monitoring for email deliverability and anti-spoofing." readme = "README.md" license = "Apache-2.0" +license-files = ["LICENSE"] requires-python = ">=3.8" authors = [ - { name = "DMARCGuard", email = "support@dmarcguard.com" }, + { name = "DMARCGuard", email = "support@dmarcguard.io" }, +] +maintainers = [ + { name = "DMARCGuard", email = "support@dmarcguard.io" }, +] +keywords = [ + "dmarc", + "spf", + "dkim", + "email", + "email-security", + "email-authentication", + "deliverability", + "anti-spoofing", + "anti-phishing", + "dmarcguard", + "sdk", ] classifiers = [ - "Development Status :: 1 - Planning", - "Programming Language :: Python :: 3", + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Communications :: Email", + "Topic :: Internet", + "Topic :: Security", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", ] [project.urls] -Homepage = "https://github.com/dmarcguardhq/dmarcguard-sdk-python" +Homepage = "https://dmarcguard.io" +Documentation = "https://dmarcguard.io/docs" Repository = "https://github.com/dmarcguardhq/dmarcguard-sdk-python" +Issues = "https://github.com/dmarcguardhq/dmarcguard-sdk-python/issues" +Changelog = "https://github.com/dmarcguardhq/dmarcguard-sdk-python/blob/main/CHANGELOG.md" + +[tool.hatch.build.targets.wheel] +packages = ["dmarcguard"] + +[tool.hatch.build.targets.sdist] +include = [ + "dmarcguard", + "README.md", + "LICENSE", + "pyproject.toml", +] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..072bcb7 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "python", + "include-component-in-tag": false, + "include-v-in-tag": true, + "pull-request-title-pattern": "chore: release ${version}", + "packages": { + ".": { + "package-name": "dmarcguard", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "generic", + "path": "dmarcguard/__init__.py" + } + ] + } + } +} From 2a995852eb9ebc98d2165411b964b65370acd190 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Apr 2026 17:49:52 +0000 Subject: [PATCH 2/2] chore: rebrand to DMARCguard and switch release-please to simple type Switch release-please to the simple release-type with explicit extra-files updaters (toml jsonpath for pyproject.toml, generic marker for __init__.py), matching the custom-version-modifier pattern used in meysam81/ansible-collections for galaxy.yml. Also correct brand casing everywhere to DMARCguard. https://claude.ai/code/session_01URvfmnKQwhTdPXA6t3xW4v --- README.md | 2 +- dmarcguard/__init__.py | 2 +- pyproject.toml | 6 +++--- release-please-config.json | 7 ++++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 025e062..f44e536 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # dmarcguard-sdk-python -Official Python SDK for [DMARCGuard](https://dmarcguard.io) — DMARC, SPF, and +Official Python SDK for [DMARCguard](https://dmarcguard.io) — DMARC, SPF, and DKIM monitoring for email deliverability and anti-spoofing. > [!NOTE] diff --git a/dmarcguard/__init__.py b/dmarcguard/__init__.py index eeb8f32..886de67 100644 --- a/dmarcguard/__init__.py +++ b/dmarcguard/__init__.py @@ -1,3 +1,3 @@ -"""Official Python SDK for DMARCGuard.""" +"""Official Python SDK for DMARCguard.""" __version__ = "0.0.1" # x-release-please-version diff --git a/pyproject.toml b/pyproject.toml index d76f785..08a91a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,16 +5,16 @@ build-backend = "hatchling.build" [project] name = "dmarcguard" version = "0.0.1" -description = "Official Python SDK for DMARCGuard — DMARC, SPF, and DKIM monitoring for email deliverability and anti-spoofing." +description = "Official Python SDK for DMARCguard — DMARC, SPF, and DKIM monitoring for email deliverability and anti-spoofing." readme = "README.md" license = "Apache-2.0" license-files = ["LICENSE"] requires-python = ">=3.8" authors = [ - { name = "DMARCGuard", email = "support@dmarcguard.io" }, + { name = "DMARCguard", email = "support@dmarcguard.io" }, ] maintainers = [ - { name = "DMARCGuard", email = "support@dmarcguard.io" }, + { name = "DMARCguard", email = "support@dmarcguard.io" }, ] keywords = [ "dmarc", diff --git a/release-please-config.json b/release-please-config.json index 072bcb7..330392c 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,14 +1,19 @@ { "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", - "release-type": "python", "include-component-in-tag": false, "include-v-in-tag": true, "pull-request-title-pattern": "chore: release ${version}", "packages": { ".": { "package-name": "dmarcguard", + "release-type": "simple", "changelog-path": "CHANGELOG.md", "extra-files": [ + { + "type": "toml", + "path": "pyproject.toml", + "jsonpath": "$.project.version" + }, { "type": "generic", "path": "dmarcguard/__init__.py"