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
26 changes: 14 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,30 @@ jobs:
- name: Calculate version
id: calc_version
run: |
# Get base version from latest stable tag (exclude rc tags, strip 'v' prefix)
LATEST_STABLE_TAG=$(git describe --tags --abbrev=0 --exclude="*rc*")
BASE_VERSION=$(echo "$LATEST_STABLE_TAG" | sed 's/^v//')
# Source of truth for base version is pyproject.toml
BASE_VERSION=$(python3 -c "
import re
text = open('pyproject.toml').read()
print(re.search(r'^version\s*=\s*\"([^\"]+)\"', text, re.MULTILINE).group(1))
")

if [[ "${{ github.ref }}" == "refs/heads/stable" ]]; then
# Stable: clean version from tag
VERSION="$BASE_VERSION"
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
# Dev: version.distancerc (e.g., 3.0.0.123rc)
DISTANCE=$(git rev-list ${LATEST_STABLE_TAG}..HEAD --count)
# Dev: base version + commit distance from stable as rc (e.g., 3.0.0.123rc)
STABLE_HEAD=$(git rev-parse origin/stable 2>/dev/null || git rev-list --max-parents=0 HEAD)
DISTANCE=$(git rev-list ${STABLE_HEAD}..HEAD --count)
VERSION="${BASE_VERSION}.${DISTANCE}rc"
fi

echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Calculated version: $VERSION"

# Write version to file for hatchling to pick up
echo "__version__ = \"$VERSION\"" > bbot/_version.py
# For dev builds, write the rc version to pyproject.toml for hatchling
# Stable builds use pyproject.toml as-is
if [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
fi
- name: Build Pypi package
if: github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/dev'
run: uv build
Expand Down Expand Up @@ -122,8 +128,6 @@ jobs:
tags: |
blacklanternsecurity/bbot:dev
blacklanternsecurity/bbot:${{ steps.version.outputs.BBOT_VERSION }}
blacklanternsecurity/bbot:${{ steps.version.outputs.BBOT_VERSION_MAJOR_MINOR }}
blacklanternsecurity/bbot:${{ steps.version.outputs.BBOT_VERSION_MAJOR }}
- name: Publish to Docker Hub (stable)
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
uses: docker/build-push-action@v6
Expand All @@ -146,8 +150,6 @@ jobs:
tags: |
blacklanternsecurity/bbot:dev-full
blacklanternsecurity/bbot:${{ steps.version.outputs.BBOT_VERSION }}-full
blacklanternsecurity/bbot:${{ steps.version.outputs.BBOT_VERSION_MAJOR_MINOR }}-full
blacklanternsecurity/bbot:${{ steps.version.outputs.BBOT_VERSION_MAJOR }}-full
- name: Publish Full Docker Image to Docker Hub (stable)
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
uses: docker/build-push-action@v6
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pipx install --pip-args '\--pre' bbot

_For more installation methods, including [Docker](https://hub.docker.com/r/blacklanternsecurity/bbot), see [Getting Started](https://www.blacklanternsecurity.com/bbot/Stable/)_

> **Speed tip:** BBOT's DNS engine spins up ten workers per resolver in `/etc/resolv.conf`. Adding more unfiltered resolvers dramatically speeds up scans. See the [sample resolv.conf](docs/data/resolv-sample.conf) and [Tips and Tricks](https://www.blacklanternsecurity.com/bbot/Stable/scanning/tips_and_tricks/#speed-up-scans-with-more-dns-resolvers) for details.

## Example Commands

### 1) Subdomain Finder
Expand Down
6 changes: 4 additions & 2 deletions bbot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from importlib.metadata import version, PackageNotFoundError

try:
from bbot._version import __version__
except ImportError:
__version__ = version("bbot")
except PackageNotFoundError:
__version__ = "0.0.0"
1 change: 0 additions & 1 deletion bbot/_version.py

This file was deleted.

Loading
Loading