diff --git a/.github/workflows/ps-build-release.yml b/.github/workflows/ps-build-release.yml new file mode 100644 index 0000000000..63eb93e7f2 --- /dev/null +++ b/.github/workflows/ps-build-release.yml @@ -0,0 +1,55 @@ +name: PS Build & Release + +on: + release: + types: + - published + +permissions: + contents: write + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install build tools + run: python -m pip install --upgrade pip build + + - name: Build wheel + run: python -m build --wheel + + - name: Verify wheel + run: | + pip install --no-deps dist/*.whl + python -c " + import sys, os + from mitmproxy.version import VERSION + tag = os.environ['GITHUB_REF_NAME'] + expected = tag.split('ps-v')[1].rsplit('-',1)[0] + pkg_ver = VERSION.split('+')[0] + if pkg_ver != expected: + print(f'VERSION MISMATCH: wheel has {VERSION}, tag is {tag} (expected base version {expected})') + sys.exit(1) + print(f'Version OK: {VERSION} matches tag {tag}') + " + + - name: Upload wheel to release + uses: softprops/action-gh-release@v2 + with: + name: "mitmproxy ps fork ${{ github.ref_name }}" + body: | + Prompt Security patched build of mitmproxy. + Tag: `${{ github.ref_name }}` + Commit: `${{ github.sha }}` + Branch: `${{ github.event.release.target_commitish }}` + fail_on_unmatched_files: true + files: dist/*.whl diff --git a/mitmproxy/version.py b/mitmproxy/version.py index dd0e6c45f8..2c2209df78 100644 --- a/mitmproxy/version.py +++ b/mitmproxy/version.py @@ -2,7 +2,7 @@ import subprocess import sys -VERSION = "12.2.1" +VERSION = "12.2.1+ps1" MITMPROXY = "mitmproxy " + VERSION # Serialization format version. This is displayed nowhere, it just needs to be incremented by one