Skip to content

Commit

Permalink
🔧 add the action to publish package
Browse files Browse the repository at this point in the history
  • Loading branch information
zrquan committed Aug 3, 2024
1 parent 5b239e2 commit 0780d53
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Upload Python Package

on:
push:
branches: [main]
tags:
- v*
pull_request:
branches: [main]

jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
rm -fr dist/ && poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ name = "nmass"
version = "0.1.0"
description = "A python3 library that makes it easier to use nmap and masscan"
authors = ["4shen0ne <4shen.01@gmail.com>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
pydantic-xml = "^2.11.0"
aiofiles = "^24.1.0"

[tool.poetry-dynamic-versioning]
enable = true

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 0780d53

Please sign in to comment.