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
59 changes: 59 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish to PyPI

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag to publish (e.g. v0.11.0). Leave empty to use the current ref."
required: false
default: ""

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Determine ref to build
id: ref
shell: bash
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "ref=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
elif [[ -n "${{ inputs.tag }}" ]]; then
echo "ref=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi

- name: Checkout repo (for tags)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch tags
run: git fetch --tags --force

- name: Checkout ref
run: |
echo "Using ref: ${{ steps.ref.outputs.ref }}"
git checkout "${{ steps.ref.outputs.ref }}"

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

- name: Build dists
run: |
python -m pip install --upgrade pip build twine
python -m build
twine check dist/*

- name: Publish to PyPI (Trusted Publishing)
uses: pypa/gh-action-pypi-publish@release/v1
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# pyproject.toml

[build-system]
requires = ["setuptools>=68", "setuptools-scm>=8", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "PyADRecon"
dynamic = ["version"]
description = "Python Active Directory Reconnaissance Tool (ADRecon port) with NTLM and Kerberos support."
readme = "README.md"
requires-python = ">=3.9"
license-files = ["LICENSE"]
license = "MIT"
authors = [{ name = "LRVT" }]
keywords = ["active-directory", "active directory", "ad", "recon", "reconnaissance", "enum", "enumeration", "adrecon", "pyadrecon", "security", "audit", "pentest", "ldap", "kerberos", "adcs", "kerberoast"]

dependencies = [
"ldap3>=2.9.1,<3",
"openpyxl>=3.1.5,<4",
"impacket>=0.13.0,<1",
"gssapi>=1.11.1,<2; sys_platform != 'win32'",
"winkerberos>=0.13.0,<1; sys_platform == 'win32'",
]

[project.urls]
Homepage = "https://github.com/l4rm4nd/PyADRecon"
Repository = "https://github.com/l4rm4nd/PyADRecon"
Issues = "https://github.com/l4rm4nd/PyADRecon/issues"

[project.scripts]
pyadrecon = "pyadrecon:main"

[tool.setuptools]
py-modules = ["pyadrecon"]

# Version comes from Git tags like v0.11.0. CI will build from the tag ref.
[tool.setuptools_scm]
tag_regex = "^v(?P<version>\\d+\\.\\d+\\.\\d+)$"
version_scheme = "release-branch-semver"
local_scheme = "no-local-version"