From a30ee154b0e7185459e3472aae6f1789726712c0 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:52:24 -0500 Subject: [PATCH 01/16] test --- .github/workflows/github-actions-demo.yml | 20 ++++++++++++++++++++ Pipfile | 4 ++++ README.md | 2 +- setup.py | 9 +++++---- 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 0000000..3ec7c0b --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,20 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +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: 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..169ea7c 100644 --- a/Pipfile +++ b/Pipfile @@ -13,3 +13,7 @@ twine = "*" [requires] python_version = "3.7" + +[pypi] +username = __token__ +password = pypi-AgEIcHlwaS5vcmcCJGNiMDY5NmE1LTJhNWItNDY2YS1iN2JhLWNiZWRjNDA2MGJlMAACKlszLCI5ODcyNWUwMi00NzAwLTQ0YmEtYmM3Yi0wY2FlMDViNjBhYjMiXQAABiAwxOxzbZi-edIXq7RvHQ1y418jR1QSAi_acihYMltbKQ \ 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..75eef9d 100644 --- a/setup.py +++ b/setup.py @@ -9,9 +9,9 @@ def read(fname): setup( - name='pymetasploit3', + name='testpymetasploit3', author='Dan McInerney', - version='1.0', + version='1.3', author_email='danhmcinerney@gmail.com', description='A full-fledged msfrpc library for Metasploit framework.', license='GPL', @@ -25,7 +25,8 @@ def read(fname): 'requests', 'retry' ], - url='https://github.com/DanMcInerney/pymetasploit3', + url='https://github.com/DanMcInerney/testpymetasploit3', 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" ) From d843999330ff0b30fc179672ea1e0181cb301dbc Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:53:54 -0500 Subject: [PATCH 02/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 3ec7c0b..147d9c2 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -15,6 +15,6 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Build distribution - run: python3 .\setup.py sdist + 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 From 8c3bf79a885fdaa4bc5971fa92060e2b4d1ebc1e Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:57:45 -0500 Subject: [PATCH 03/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 147d9c2..a87dbfd 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -14,6 +14,10 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: + - name: Checkout files + uses: actions/checkout@v4 + with: + ref: master - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 20e2ca1d4c8edda506e1348e27ef19252c69464f Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:15:31 -0500 Subject: [PATCH 04/16] test --- .github/workflows/github-actions-demo.yml | 11 +++++++++-- setup.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index a87dbfd..7e2da79 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,5 +1,5 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +name: Build and upload to PyPI +run-name: Building and releasing to PyPI on: push: branches: @@ -18,6 +18,13 @@ jobs: uses: actions/checkout@v4 with: ref: master + - name: Increment version number + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "VERSION_NUMBER" + replace: ${{ github.run_attempt }} + regex: false + include: "**setup.py" - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI diff --git a/setup.py b/setup.py index 75eef9d..ce1403f 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def read(fname): setup( name='testpymetasploit3', author='Dan McInerney', - version='1.3', + version='VERSION_NUMBER', author_email='danhmcinerney@gmail.com', description='A full-fledged msfrpc library for Metasploit framework.', license='GPL', From bf97f8f66926db383a6285fa5b4d8b977079f67c Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:15:55 -0500 Subject: [PATCH 05/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 7e2da79..4dfdaeb 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -19,12 +19,12 @@ jobs: with: ref: master - name: Increment version number - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: "VERSION_NUMBER" - replace: ${{ github.run_attempt }} - regex: false - include: "**setup.py" + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "VERSION_NUMBER" + replace: ${{ github.run_attempt }} + regex: false + include: "**setup.py" - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 30c16261c388839863a0b1f7fc88b65493b63d2e Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:17:16 -0500 Subject: [PATCH 06/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 4dfdaeb..314d50c 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -24,7 +24,7 @@ jobs: find: "VERSION_NUMBER" replace: ${{ github.run_attempt }} regex: false - include: "**setup.py" + include: "setup.py" - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 3a211c81e01d4d9b2a8ceb9376157d0d70274e84 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:18:03 -0500 Subject: [PATCH 07/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 314d50c..bf89157 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -24,7 +24,7 @@ jobs: find: "VERSION_NUMBER" replace: ${{ github.run_attempt }} regex: false - include: "setup.py" + include: "./setup.py" - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 8c94f64af3485fc72c3cd96076864a431ea399ef Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:19:20 -0500 Subject: [PATCH 08/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index bf89157..314d50c 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -24,7 +24,7 @@ jobs: find: "VERSION_NUMBER" replace: ${{ github.run_attempt }} regex: false - include: "./setup.py" + include: "setup.py" - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 23a787c4fa53e68b3e710382748edf02963e5ad0 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:21:14 -0500 Subject: [PATCH 09/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 314d50c..312097e 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -25,6 +25,9 @@ jobs: replace: ${{ github.run_attempt }} regex: false include: "setup.py" + - name: Debug setup.py + run: + run: cat setup.py - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 748cd39cb386a64f838c74c3d50f1db34c8badd3 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:21:44 -0500 Subject: [PATCH 10/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 312097e..5deaccd 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -26,8 +26,7 @@ jobs: regex: false include: "setup.py" - name: Debug setup.py - run: - run: cat setup.py + run: cat setup.py - name: Build distribution run: python3 setup.py sdist - name: Publish package distributions to PyPI From 03c70115e1077490980869ecaa2a3c7f067192a9 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:23:11 -0500 Subject: [PATCH 11/16] test --- .github/workflows/github-actions-demo.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 5deaccd..dff385c 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -21,7 +21,7 @@ jobs: - name: Increment version number uses: jacobtomlinson/gha-find-replace@v3 with: - find: "VERSION_NUMBER" + find: "VERSION_MINOR_RELEASE" replace: ${{ github.run_attempt }} regex: false include: "setup.py" diff --git a/setup.py b/setup.py index ce1403f..94a2a8e 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def read(fname): setup( name='testpymetasploit3', author='Dan McInerney', - version='VERSION_NUMBER', + version='1.4VERSION_MINOR_RELEASE', author_email='danhmcinerney@gmail.com', description='A full-fledged msfrpc library for Metasploit framework.', license='GPL', From f3ed9f004cc8bae337ff3fd18ffc7ba0a929210a Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:24:18 -0500 Subject: [PATCH 12/16] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index dff385c..0e4db8b 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/p/pymetasploit3 + url: https://pypi.org/p/pymetasploit3 #testcomment permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: From 5ac8bfa6c3798b0243d4a17b582177789412092f Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:36:02 -0500 Subject: [PATCH 13/16] test --- .github/workflows/github-actions-demo.yml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 0e4db8b..288da90 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -21,8 +21,8 @@ jobs: - name: Increment version number uses: jacobtomlinson/gha-find-replace@v3 with: - find: "VERSION_MINOR_RELEASE" - replace: ${{ github.run_attempt }} + find: "GITHUB_RUN_NUMBER.GITHUB_RUN_ATTEMPT" + replace: ${{ github.run_number }}.${{ github.run_attempt }} regex: false include: "setup.py" - name: Debug setup.py diff --git a/setup.py b/setup.py index 94a2a8e..49d6dde 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def read(fname): setup( name='testpymetasploit3', author='Dan McInerney', - version='1.4VERSION_MINOR_RELEASE', + version='1.5.GITHUB_RUN_NUMBER.GITHUB_RUN_ATTEMPT', author_email='danhmcinerney@gmail.com', description='A full-fledged msfrpc library for Metasploit framework.', license='GPL', From ce4efdbde095ab0371f0764e98271b139f284972 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:37:56 -0500 Subject: [PATCH 14/16] test --- .../{github-actions-demo.yml => buildandreleasepypi.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{github-actions-demo.yml => buildandreleasepypi.yml} (94%) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/buildandreleasepypi.yml similarity index 94% rename from .github/workflows/github-actions-demo.yml rename to .github/workflows/buildandreleasepypi.yml index 288da90..a4ae64a 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/buildandreleasepypi.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 with: ref: master - - name: Increment version number + - name: Replace run number and attempt in setup.py uses: jacobtomlinson/gha-find-replace@v3 with: find: "GITHUB_RUN_NUMBER.GITHUB_RUN_ATTEMPT" From 726f6ac6e15592c0e66fbe282ed1e08a459817a8 Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:40:15 -0500 Subject: [PATCH 15/16] Update buildandreleasepypi.yml --- .github/workflows/buildandreleasepypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildandreleasepypi.yml b/.github/workflows/buildandreleasepypi.yml index a4ae64a..7fecd14 100644 --- a/.github/workflows/buildandreleasepypi.yml +++ b/.github/workflows/buildandreleasepypi.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/p/pymetasploit3 #testcomment + url: https://pypi.org/p/pymetasploit3 permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: From dbf1818c1b826d899dd1daf1579426723e40b05c Mon Sep 17 00:00:00 2001 From: Blake <80996688+BlakeTnr@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:44:13 -0500 Subject: [PATCH 16/16] Undo changes for using my test repo --- Pipfile | 6 +----- setup.py | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Pipfile b/Pipfile index 169ea7c..1fb567c 100644 --- a/Pipfile +++ b/Pipfile @@ -12,8 +12,4 @@ pytest = "*" twine = "*" [requires] -python_version = "3.7" - -[pypi] -username = __token__ -password = pypi-AgEIcHlwaS5vcmcCJGNiMDY5NmE1LTJhNWItNDY2YS1iN2JhLWNiZWRjNDA2MGJlMAACKlszLCI5ODcyNWUwMi00NzAwLTQ0YmEtYmM3Yi0wY2FlMDViNjBhYjMiXQAABiAwxOxzbZi-edIXq7RvHQ1y418jR1QSAi_acihYMltbKQ \ No newline at end of file +python_version = "3.7" \ No newline at end of file diff --git a/setup.py b/setup.py index 49d6dde..be7e97d 100644 --- a/setup.py +++ b/setup.py @@ -9,9 +9,9 @@ def read(fname): setup( - name='testpymetasploit3', + name='pymetasploit3', author='Dan McInerney', - version='1.5.GITHUB_RUN_NUMBER.GITHUB_RUN_ATTEMPT', + 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', @@ -25,7 +25,7 @@ def read(fname): 'requests', 'retry' ], - url='https://github.com/DanMcInerney/testpymetasploit3', + url='https://github.com/DanMcInerney/pymetasploit3', download_url='https://github.com/DanMcInerney/pymetasploit3/zipball/master', long_description=read('README.md'), long_description_content_type="text/markdown"