From b4be55116c8d41c7935467e8dd997712d69d707a Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Sun, 25 Aug 2024 13:38:06 +0200 Subject: [PATCH] git workflow --- .github/workflows/build-publish.yml | 16 +++++++ .github/workflows/pypi-publish.yml | 67 ----------------------------- poetry.lock | 4 +- pyproject.toml | 2 +- 4 files changed, 19 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/build-publish.yml delete mode 100644 .github/workflows/pypi-publish.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..494606e --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,16 @@ +name: build and publish + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v2.0 + with: + poetry_version: "==1.8.2" + pypi_token: ${{ secrets.PYPI_API_TOKEN_PYMODES }} diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml deleted file mode 100644 index 639c4a6..0000000 --- a/.github/workflows/pypi-publish.yml +++ /dev/null @@ -1,67 +0,0 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: publish - -on: - release: - types: [created] - workflow_dispatch: - -env: - POETRY_VERSION: "1.6.1" - -jobs: - deploy: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Add poetry to windows path - if: "startsWith(runner.os, 'windows')" - run: | - echo "C:\Users\runneradmin\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Install and configure Poetry - uses: snok/install-poetry@v1.4.0 - with: - version: ${{ env.POETRY_VERSION }} - virtualenvs-create: true - virtualenvs-in-project: true - - - name: Display Python version - run: poetry run python -c "import sys; print(sys.version)" - - - name: Build packages - run: poetry build - - - name: Install dependencies - run: | - poetry run pip install --upgrade pip - poetry run pip install twine - - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - poetry run twine upload dist/*.whl - - - name: Build and publish (source) - if: ${{ startsWith(runner.os, 'windows') && matrix.python-version == '3.11' }} - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - poetry run twine upload dist/*.tar.gz diff --git a/poetry.lock b/poetry.lock index 90489c9..97101e4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -877,5 +877,5 @@ rtlsdr = ["pyrtlsdr"] [metadata] lock-version = "2.0" -python-versions = "^3.9" -content-hash = "99bee66d485fec146c4951b52b6d29ccd68254e733f12af4493bac432cb9b434" +python-versions = ">=3.9" +content-hash = "f92c8f8bdcbe5a3351cbe1c026b19b913c9b4502e6ecc3a35b3cbef4d48fee7d" diff --git a/pyproject.toml b/pyproject.toml index a4a7a7b..6d1cb45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ build = "build.py" modeslive = "pyModeS.streamer.modeslive:main" [tool.poetry.dependencies] -python = "^3.9" +python = ">=3.9" numpy = ">=1.26" pyzmq = ">=24.0" pyrtlsdr = { version = ">=0.2.93", optional = true }