Skip to content

Commit

Permalink
add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jan 29, 2024
1 parent cc4c807 commit 66822b5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish-python-package.yml
@@ -0,0 +1,34 @@
# https://docs.pypi.org/trusted-publishers/using-a-publisher/

name: publish

on:
release:
types: [published]

jobs:
release:

runs-on: ubuntu-latest

environment: release

permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install builder
run: pip install build

- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 5 additions & 2 deletions pyproject.toml
Expand Up @@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta"

[project]
name = "findssh"
version = "2.0.0"
description = "find open servers on IPv4 subnet such as SSH"
keywords = ["port-scan", "ssh"]
classifiers = [
Expand All @@ -24,15 +23,19 @@ classifiers = [
"Topic :: System :: Networking",
"Topic :: Utilities"
]
dynamic = ["readme"]
dynamic = ["readme", "version"]
requires-python = ">=3.9"

[project.scripts]
findssh = "findssh.__main__:main"

[project.optional-dependencies]
tests = ["pytest"]
lint = ["flake8", "flake8-bugbear", "flake8-builtins", "flake8-blind-except", "mypy"]

[tool.setuptools.dynamic]
readme = {file = ["README.md"], content-type = "text/markdown"}
version = {attr = "findssh.__version__"}

[tool.black]
line-length = 90
Expand Down
2 changes: 2 additions & 0 deletions src/findssh/__init__.py
Expand Up @@ -6,6 +6,8 @@

__all__ = ["get_hosts", "address2net", "get_lan_ip"]

__version__ = "2.0.1"


def get_lan_ip() -> ipaddress.IPv4Address | ipaddress.IPv6Address:
"""
Expand Down

0 comments on commit 66822b5

Please sign in to comment.