From a100b1c92b57456324404bae348baa0c35b407f8 Mon Sep 17 00:00:00 2001 From: liquidsec Date: Mon, 19 Oct 2026 11:36:01 -0400 Subject: [PATCH] revert: restore pre-#304 CI and release setup PR #304 fixed provider attribution in src/lib.rs but also replaced the CI/release pipeline (shared reusable workflows, tag-driven publish, dynamic version). Restore the previous workflows, pyproject version, uv.lock, and README so releases keep working under the old system while the new CLI is developed. The lookup fix itself is untouched. --- .github/workflows/cla.yml | 91 +++++++- .github/workflows/daily-update.yml | 14 +- .github/workflows/docker-tests.yml | 97 +++++++++ .github/workflows/pipeline-tests.yml | 33 +++ .github/workflows/publish.yml | 76 ------- .github/workflows/python-tests.yml | 297 +++++++++++++++++++++++++++ .github/workflows/rust-tests.yml | 60 ++++++ .github/workflows/tests.yml | 34 --- README.md | 18 +- pyproject.toml | 5 +- scripts/wheel-container-setup.sh | 8 - uv.lock | 1 + 12 files changed, 587 insertions(+), 147 deletions(-) create mode 100644 .github/workflows/docker-tests.yml create mode 100644 .github/workflows/pipeline-tests.yml delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/python-tests.yml create mode 100644 .github/workflows/rust-tests.yml delete mode 100644 .github/workflows/tests.yml delete mode 100644 scripts/wheel-container-setup.sh diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index f6b10c0..0aa06e5 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -1,5 +1,4 @@ -name: CLA - +name: "CLA Assistant" on: issue_comment: types: [created] @@ -11,6 +10,88 @@ permissions: statuses: write jobs: - cla: - uses: blacklanternsecurity/CLA/.github/workflows/cla-reusable.yml@4f85d3c525483f0f846ef4384a8ece24a3c74375 # 2026-09-29 - secrets: inherit + CLAAssistant: + runs-on: ubuntu-24.04 + steps: + - name: Generate token from GitHub App + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: blacklanternsecurity + + - name: Check all committers against org and allowlist + id: cla-check + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + run: | + if [ "${{ github.event_name }}" = "pull_request_target" ]; then + PR_NUM="${{ github.event.pull_request.number }}" + else + PR_NUM="${{ github.event.issue.number }}" + fi + + COMMITTERS=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUM/commits" --paginate --jq '.[].author.login' | sort -u) + ALL_EXEMPT=true + + for LOGIN in $COMMITTERS; do + # treat commits with no associated GitHub login as non-exempt + if [ -z "$LOGIN" ] || [ "$LOGIN" = "null" ]; then + echo "Unknown committer (no GitHub login) — not exempt" + ALL_EXEMPT=false + break + fi + + EXEMPT=false + + # check if account type is Bot (GitHub App accounts) + AUTHOR_TYPE=$(gh api "users/${LOGIN}" --jq '.type' 2>/dev/null || echo "Unknown") + if [ "$AUTHOR_TYPE" = "Bot" ]; then + echo "$LOGIN is a Bot account — exempt" + EXEMPT=true + fi + + # check org membership + if [ "$EXEMPT" = "false" ]; then + if gh api "orgs/blacklanternsecurity/members/$LOGIN" > /dev/null 2>&1; then + echo "$LOGIN is an org member — exempt" + EXEMPT=true + fi + fi + + if [ "$EXEMPT" = "false" ]; then + echo "$LOGIN is not exempt — CLA required" + ALL_EXEMPT=false + break + fi + done + + echo "all_exempt=$ALL_EXEMPT" >> "$GITHUB_OUTPUT" + + - name: Skip CLA when all committers are exempt + if: steps.cla-check.outputs.all_exempt == 'true' && github.event_name == 'pull_request_target' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api --method POST "repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" \ + -f state=success \ + -f context="CLAAssistant" \ + -f description="CLA check skipped — all committers are org members or bots" + + - name: "CLA Assistant" + if: | + (steps.cla-check.outputs.all_exempt != 'true') && + ((github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target') + uses: contributor-assistant/github-action@v2.6.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }} + with: + path-to-signatures: "signatures/version1/cla.json" + path-to-document: "https://github.com/blacklanternsecurity/CLA/blob/main/ICLA.md" + branch: "main" + allowlist: "dependabot[bot],github-actions[bot],renovate[bot]" + remote-organization-name: "blacklanternsecurity" + remote-repository-name: "CLA" + lock-pullrequest-aftermerge: "false" diff --git a/.github/workflows/daily-update.yml b/.github/workflows/daily-update.yml index 194b50b..192b0b8 100644 --- a/.github/workflows/daily-update.yml +++ b/.github/workflows/daily-update.yml @@ -6,9 +6,6 @@ on: - cron: '0 6 * * *' workflow_dispatch: # Allow manual trigger -permissions: - contents: read - # Prevent concurrent runs from racing to commit/merge # cancel-in-progress: false means new runs wait instead of canceling in-progress ones concurrency: @@ -24,19 +21,24 @@ jobs: steps: - name: Generate app token id: app-token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + uses: actions/create-github-app-token@v3 with: app-id: ${{ secrets.CLOUDCHECK_APP_ID }} private-key: ${{ secrets.CLOUDCHECK_APP_PRIVATE_KEY }} - name: Checkout stable branch - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + uses: actions/checkout@v7 with: ref: stable token: ${{ steps.app-token.outputs.token }} + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.12" + - name: Set up uv - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + uses: astral-sh/setup-uv@v7 - name: Install dependencies run: uv sync diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml new file mode 100644 index 0000000..0625a6f --- /dev/null +++ b/.github/workflows/docker-tests.yml @@ -0,0 +1,97 @@ +name: Docker Tests + +on: + push: + branches: [ stable ] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docker-test: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + pip install requests + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Run Docker tests + run: | + python test_docker.py + + docker-publish: + runs-on: ubuntu-24.04 + needs: docker-test + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/stable' }} + + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: blacklanternsecurity + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v6 + with: + images: blacklanternsecurity/cloudcheck + tags: | + type=ref,event=branch + type=ref,event=pr + type=sha,prefix=sha- + type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=v11 + type=raw,value=v11.2 + type=raw,value=v11.2.0 + + - name: Build and push Docker image + uses: docker/build-push-action@v7 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Clean up old Docker Hub tags (up to 50 most recent tags plus 'latest') + run: | + # Install jq for JSON processing + sudo apt-get update && sudo apt-get install -y jq + + echo "Cleaning up blacklanternsecurity/cloudcheck tags..." + + tags_response=$(curl -s -H "Authorization: Bearer ${{ secrets.DOCKER_TOKEN }}" \ + "https://hub.docker.com/v2/repositories/blacklanternsecurity/cloudcheck/tags/?page_size=100") + + tags_to_delete=$(echo "$tags_response" | jq -r '.results[] | select(.name != "latest") | [.last_updated, .name] | @tsv' | \ + sort -r | tail -n +11 | cut -f2) + + for tag in $tags_to_delete; do + echo "Deleting blacklanternsecurity/cloudcheck tag: $tag" + curl -X DELETE -H "Authorization: Bearer ${{ secrets.DOCKER_TOKEN }}" \ + "https://hub.docker.com/v2/repositories/blacklanternsecurity/cloudcheck/tags/$tag/" + done + + echo "Cleanup completed for blacklanternsecurity/cloudcheck. Kept 50 most recent tags plus 'latest'." diff --git a/.github/workflows/pipeline-tests.yml b/.github/workflows/pipeline-tests.yml new file mode 100644 index 0000000..0b9476f --- /dev/null +++ b/.github/workflows/pipeline-tests.yml @@ -0,0 +1,33 @@ +name: Pipeline Tests + +on: + push: + branches: [ stable ] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: 3.x + + - name: Set up uv + uses: astral-sh/setup-uv@v7 + + - name: Install dependencies + run: | + uv sync + + - name: Run tests + run: | + uv run pytest cloudcheck_update/test_cloudcheck_update.py -v diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 80a06bf..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Publish - -on: - push: - tags: ["v*"] - -permissions: - contents: read - -concurrency: - group: publish-${{ github.ref }} - cancel-in-progress: false - -jobs: - check: - uses: blacklanternsecurity/CLA/.github/workflows/release-check.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - - tests: - needs: check - uses: ./.github/workflows/tests.yml - - wheels: - needs: tests - uses: blacklanternsecurity/CLA/.github/workflows/maturin-wheels.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - with: - # No s390x wheel has ever been published for cloudcheck. - targets: '{"linux": ["x86_64", "x86", "aarch64", "armv7", "ppc64le"], "musllinux": ["x86_64", "x86", "aarch64", "armv7"], "windows": ["x64", "x86"], "macos": ["x86_64", "aarch64"]}' - before-script-linux: scripts/wheel-container-setup.sh - - crates: - needs: wheels - uses: blacklanternsecurity/CLA/.github/workflows/crates.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - secrets: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - # Trusted publishing only matches a top-level job, so PyPI cannot move into a reusable workflow. - pypi: - needs: wheels - runs-on: ubuntu-24.04 - environment: pypi - permissions: - id-token: write - attestations: write - steps: - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - pattern: ${{ needs.wheels.outputs.artifacts }} - path: dist - merge-multiple: true - - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 - with: - subject-path: dist/* - - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 - - docker: - needs: [check, wheels] - uses: blacklanternsecurity/CLA/.github/workflows/docker.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - secrets: inherit - with: - image: ${{ github.repository }} - version: ${{ needs.check.outputs.version }} - prerelease: ${{ needs.check.outputs.prerelease }} - major: ${{ needs.check.outputs.major }} - minor: ${{ needs.check.outputs.minor }} - - release: - needs: [check, wheels, crates, pypi, docker] - permissions: - contents: write - uses: blacklanternsecurity/CLA/.github/workflows/publish.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - with: - version: ${{ needs.check.outputs.version }} - prerelease: ${{ needs.check.outputs.prerelease }} - images: ${{ needs.docker.outputs.images }} - artifacts: ${{ needs.wheels.outputs.artifacts }} - assets: dist/* diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000..956195b --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,297 @@ +name: Python Tests + +on: + push: + branches: + - stable + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-24.04 + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up uv + uses: astral-sh/setup-uv@v7 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v2 + + - name: Install dependencies + run: | + uv sync + + - name: Build Python bindings + run: | + uv run maturin develop --release + + - name: Run Python tests + run: | + uv run pytest test_cloudcheck.py -v + + publish: + runs-on: ubuntu-24.04 + needs: test + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + permissions: + contents: write + steps: + - name: Generate app token + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.CLOUDCHECK_APP_ID }} + private-key: ${{ secrets.CLOUDCHECK_APP_PRIVATE_KEY }} + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.x" + - name: Set up Rust + uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # 2026-09-03, no release tag + - name: Set up uv + uses: astral-sh/setup-uv@v7 + - name: Get current version + id: get_version + run: | + VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') + echo "VERSION=v${VERSION}" >> $GITHUB_OUTPUT + - name: Check for version change + id: version_check + run: | + git fetch --tags + LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo "none") + CURRENT="${{ steps.get_version.outputs.VERSION }}" + if [ "$LATEST_TAG" = "$CURRENT" ]; then + echo "changed=false" >> $GITHUB_OUTPUT + else + echo "changed=true" >> $GITHUB_OUTPUT + fi + - name: Build PyPi package + run: uv run maturin build --release --out dist + - name: Publish PyPi package + run: uv run maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} + - name: Tag release + if: steps.version_check.outputs.changed == 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${{ steps.get_version.outputs.VERSION }}" -m "Release ${{ steps.get_version.outputs.VERSION }}" + git push origin "refs/tags/${{ steps.get_version.outputs.VERSION }}" + linux: + runs-on: ${{ matrix.platform.runner }} + needs: publish + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + strategy: + matrix: + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + # get rekt ibm + # - runner: ubuntu-22.04 + # target: s390x + - runner: ubuntu-22.04 + target: ppc64le + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: false + manylinux: auto + before-script-linux: | + if command -v apt-get >/dev/null 2>&1; then + # Debian-based + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev perl make gcc g++ binutils + elif command -v yum >/dev/null 2>&1; then + # CentOS-based + yum update -y + yum install -y openssl openssl-devel perl perl-core make gcc gcc-c++ binutils + else + echo "Error: Neither apt-get nor yum found" + exit 1 + fi + - name: Upload wheels + uses: actions/upload-artifact@v7 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist + + musllinux: + runs-on: ${{ matrix.platform.runner }} + needs: publish + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + strategy: + matrix: + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: false + manylinux: musllinux_1_2 + before-script-linux: | + if command -v apk >/dev/null 2>&1; then + # Alpine (musllinux) + apk add --no-cache openssl-dev pkgconfig perl make musl-dev + elif command -v apt-get >/dev/null 2>&1; then + # Debian-based + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev perl make gcc g++ binutils + elif command -v yum >/dev/null 2>&1; then + # CentOS-based + yum update -y + yum install -y openssl openssl-devel perl perl-core make gcc gcc-c++ binutils + else + echo "Error: No supported package manager found" + exit 1 + fi + + - name: Upload wheels + uses: actions/upload-artifact@v7 + with: + name: wheels-musllinux-${{ matrix.platform.target }} + path: dist + + windows: + runs-on: ${{ matrix.platform.runner }} + needs: publish + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: 3.x + architecture: ${{ matrix.platform.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: false + - name: Upload wheels + uses: actions/upload-artifact@v7 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist + + macos: + runs-on: ${{ matrix.platform.runner }} + needs: publish + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + strategy: + matrix: + platform: + - runner: macos-15-intel + target: x86_64 + - runner: macos-latest + target: aarch64 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: false + - name: Upload wheels + uses: actions/upload-artifact@v7 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist + + sdist: + runs-on: ubuntu-24.04 + needs: publish + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + steps: + - uses: actions/checkout@v7 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + - name: Upload sdist + uses: actions/upload-artifact@v7 + with: + name: wheels-sdist + path: dist + + release: + name: Release + runs-on: ubuntu-24.04 + needs: [linux, musllinux, windows, macos, sdist] + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + permissions: + # Use to sign the release artifacts + id-token: write + # Used to upload release artifacts + contents: write + # Used to generate artifact attestation + attestations: write + steps: + - uses: actions/download-artifact@v8 + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v4 + with: + subject-path: 'wheels-*/*' + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing wheels-*/* \ No newline at end of file diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml new file mode 100644 index 0000000..b45087b --- /dev/null +++ b/.github/workflows/rust-tests.yml @@ -0,0 +1,60 @@ +name: Rust tests + +on: + push: + branches: [ stable ] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v7 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v2 + + - name: Cache Rust dependencies + uses: actions/cache@v6 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Check formatting + run: cargo fmt --all -- --check + + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Run tests + run: cargo test --verbose --all-features + + publish: + needs: test + runs-on: ubuntu-24.04 + if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + + steps: + - uses: actions/checkout@v7 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v2 + + - name: Publish to crates.io + run: | + VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version') + if cargo search cloudcheck --limit 1 | head -1 | grep -q "$VERSION"; then + echo "Version $VERSION already exists on crates.io, skipping publish" + else + cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} + fi diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 52496c9..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Tests - -on: - pull_request: - push: - branches: [stable] - workflow_call: - -concurrency: - group: tests-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -permissions: - contents: read - -jobs: - rust: - uses: blacklanternsecurity/CLA/.github/workflows/rust-tests.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - with: - cargo-args: --all-features --locked - - python: - uses: blacklanternsecurity/CLA/.github/workflows/python-tests.yml@e532142ee9e7322888f6edc80d9a89e2f8c0d96d # feat/shared-workflows - with: - pytest-args: test_cloudcheck.py cloudcheck_update -v - - docker: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 - - run: uv run --with requests python test_docker.py diff --git a/README.md b/README.md index 9b251fa..a845336 100644 --- a/README.md +++ b/README.md @@ -89,12 +89,10 @@ pip install cloudcheck import asyncio from cloudcheck import CloudCheck - async def main(): cloudcheck = CloudCheck() results = await cloudcheck.lookup("8.8.8.8") - print(results) # [{'name': 'Google', 'tags': ['cloud']}] - + print(results) # [{'name': 'Google', 'tags': ['cloud']}] asyncio.run(main()) ``` @@ -105,7 +103,6 @@ asyncio.run(main()) import asyncio from cloudcheck import CloudCheck, CloudCheckError - async def main(): cloudcheck = CloudCheck() try: @@ -114,7 +111,6 @@ async def main(): except CloudCheckError as e: print(f"Error: {e}") - asyncio.run(main()) ``` @@ -124,19 +120,17 @@ asyncio.run(main()) import asyncio from cloudcheck import CloudCheck - async def main(): # Custom configuration cloudcheck = CloudCheck( signature_url="https://example.com/custom.json", # Custom signature URL - max_retries=5, # Max retry attempts (default: 10) - retry_delay_seconds=2, # Delay between retries (default: 1) - force_refresh=True, # Force fresh fetch (default: False) + max_retries=5, # Max retry attempts (default: 10) + retry_delay_seconds=2, # Delay between retries (default: 1) + force_refresh=True # Force fresh fetch (default: False) ) results = await cloudcheck.lookup("8.8.8.8") print(results) - asyncio.run(main()) ``` @@ -330,7 +324,3 @@ cargo fmt --all cargo clippy --all-targets --all-features -- -D warnings ``` - -## Releasing - -Releases are cut by pushing a `vMAJOR.MINOR.PATCH` (or `vMAJOR.MINOR.PATCH-rc.N`) tag with the org's [release.sh](https://github.com/blacklanternsecurity/CLA/blob/e532142ee9e7322888f6edc80d9a89e2f8c0d96d/scripts/release.sh), after the version bump is merged. The tag must equal the manifest version. `publish.yml` then tests, builds, publishes, and creates the GitHub release with its SBOM in the same run. diff --git a/pyproject.toml b/pyproject.toml index 6537870..f6920d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cloudcheck" -dynamic = ["version"] +version = "11.2.0" description = "Detailed database of cloud providers. Instantly look up a domain or IP address" readme = "README.md" requires-python = ">=3.10" @@ -24,6 +24,3 @@ dev = [ no-default-features = true features = ["py"] module-name = "cloudcheck" - -[tool.ruff.lint] -select = ["E4", "E7", "E9", "F"] diff --git a/scripts/wheel-container-setup.sh b/scripts/wheel-container-setup.sh deleted file mode 100644 index 8a83880..0000000 --- a/scripts/wheel-container-setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Sourced by maturin-action inside the manylinux and musllinux containers; vendored OpenSSL needs perl and make. -if command -v apk >/dev/null 2>&1; then - apk add --no-cache perl make musl-dev -elif command -v yum >/dev/null 2>&1; then - yum install -y perl-core make gcc -elif command -v apt-get >/dev/null 2>&1; then - apt-get update && apt-get install -y perl make gcc -fi diff --git a/uv.lock b/uv.lock index 347c039..574fa34 100644 --- a/uv.lock +++ b/uv.lock @@ -80,6 +80,7 @@ wheels = [ [[package]] name = "cloudcheck" +version = "11.2.0" source = { editable = "." } [package.dev-dependencies]