diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..911f8399 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,83 @@ +name: Build And Publish Python Distribution 📦 + +on: push + # push: + # branches: + # - main + # tags: + # - 'v[0-9]+.[0-9]+.[0-9]+' + # pull_request: + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Install uv + uses: astral-sh/setup-uv@v6 + + - name: Fetch frida dependecies + run: | + make git-submodules + + - name: Build the package + run: uv build + + - name: Upload build artifact` + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-testpypi: + name: Publish to TestPyPI 🐍 + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/frida-tools + + permissions: + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + + publish-to-pypi: + name: >- + Publish to PyPI 🐍 + if: startsWith(github.ref, 'refs/tags/') + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/frida-tools + permissions: + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/Makefile b/Makefile index 8774db73..23b46b68 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PYTHON ?= $(shell which python3 >/dev/null && echo python3 || echo python) -all $(MAKECMDGOALS): +all $(filter-out git-submodules,$(MAKECMDGOALS)):: @$(PYTHON) \ -c "import sys; sys.path.insert(0, sys.argv[1]); from releng.meson_make import main; main()" \ "$(shell pwd)" \