Skip to content

Commit

Permalink
Merge pull request #99 from BlakeTnr/master
Browse files Browse the repository at this point in the history
Fix PyPI setup.py formatting and added GitHub Actions PyPI publishing
  • Loading branch information
DanMcInerney authored Nov 28, 2023
2 parents 2adc95c + dbf1818 commit bd0989d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/buildandreleasepypi.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pytest = "*"
twine = "*"

[requires]
python_version = "3.7"
python_version = "3.7"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
description='A full-fledged msfrpc library for Metasploit framework.',
license='GPL',
Expand All @@ -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"
)

0 comments on commit bd0989d

Please sign in to comment.