diff --git a/.github/workflows/buildandreleasepypi.yml b/.github/workflows/buildandreleasepypi.yml new file mode 100644 index 0000000..7fecd14 --- /dev/null +++ b/.github/workflows/buildandreleasepypi.yml @@ -0,0 +1,33 @@ +name: Build and upload to PyPI +run-name: Building and releasing to PyPI +on: + push: + branches: + - master +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pymetasploit3 + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Checkout files + uses: actions/checkout@v4 + with: + ref: master + - name: Replace run number and attempt in setup.py + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "GITHUB_RUN_NUMBER.GITHUB_RUN_ATTEMPT" + replace: ${{ github.run_number }}.${{ github.run_attempt }} + regex: false + include: "setup.py" + - name: Debug setup.py + run: cat setup.py + - name: Build distribution + run: python3 setup.py sdist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/Pipfile b/Pipfile index da8dd4c..1fb567c 100644 --- a/Pipfile +++ b/Pipfile @@ -12,4 +12,4 @@ pytest = "*" twine = "*" [requires] -python_version = "3.7" +python_version = "3.7" \ No newline at end of file diff --git a/README.md b/README.md index c9e5f8c..4364ba6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Pymetasploit3 -======= +============= Pymetasploit3 is a full-fledged Python3 Metasploit automation library. It can interact with Metasploit either through msfrpcd or the msgrpc plugin in msfconsole. diff --git a/setup.py b/setup.py index f0a8453..be7e97d 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def read(fname): setup( name='pymetasploit3', author='Dan McInerney', - version='1.0', + version='1.0.GITHUB_RUN_NUMBER.GITHUB_RUN_ATTEMPT', author_email='danhmcinerney@gmail.com', description='A full-fledged msfrpc library for Metasploit framework.', license='GPL', @@ -27,5 +27,6 @@ def read(fname): ], url='https://github.com/DanMcInerney/pymetasploit3', download_url='https://github.com/DanMcInerney/pymetasploit3/zipball/master', - long_description=read('README.md') + long_description=read('README.md'), + long_description_content_type="text/markdown" )