From 0967cfaf9bcf01c0c8192c99051ae5b26545dc9d Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Sun, 17 May 2026 22:56:50 +0200 Subject: [PATCH 1/3] build: Add pypi upload on release --- .github/workflows/build-and-release.yml | 48 +++++++++++++++++++++---- README.md | 5 ++- scripts/build-python-dist | 5 +++ 3 files changed, 50 insertions(+), 8 deletions(-) create mode 100755 scripts/build-python-dist diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 6e7acaa..6ab625f 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -7,6 +7,26 @@ defaults: shell: bash jobs: + build-python: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Install uv + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 + + - name: Set up project + run: uv sync + + - name: Build + run: | + ./scripts/build-python-dist + + - name: Upload binary + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: python-dist + path: dist/ build: runs-on: ${{ matrix.os }} @@ -16,10 +36,10 @@ jobs: os: [ubuntu-latest, windows-latest, macos-15-intel, macos-latest] python: ["3.11"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Install uv - uses: astral-sh/setup-uv@v8.0.0 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: python-version: ${{ matrix.python }} @@ -45,7 +65,7 @@ jobs: run: mv dist/pferd* dist/pferd-${{ matrix.os }} - name: Upload binary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: pferd-${{ matrix.os }} path: dist/pferd-${{ matrix.os }} @@ -53,11 +73,16 @@ jobs: release: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') - needs: build + permissions: + contents: write + id-token: write + needs: + - build + - build-python + environment: pypi steps: - - name: Download binaries - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: pferd-* merge-multiple: true @@ -69,8 +94,17 @@ jobs: mv pferd-macos-15-intel pferd-mac-x86_64 mv pferd-macos-latest pferd-mac + - name: Download Python dist + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: python-dist + path: dist + + - name: Publish package on PyPi + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + - name: Create release - uses: softprops/action-gh-release@v3 + uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/README.md b/README.md index c96fea0..ab05b1e 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ Ensure you have at least Python 3.11 installed. Run the following command to install PFERD or upgrade it to the latest version: ``` +# install from PyPi +$ pip install PFERD +# install from GitHub $ pip install --upgrade git+https://github.com/Garmelon/PFERD@latest ``` @@ -28,7 +31,7 @@ The use of [venv](https://docs.python.org/3/library/venv.html) is recommended. ### With package managers -Unofficial packages are available for: +Packages are available for: - [AUR](https://aur.archlinux.org/packages/pferd) - [brew](https://formulae.brew.sh/formula/pferd) - [conda-forge](https://github.com/conda-forge/pferd-feedstock) diff --git a/scripts/build-python-dist b/scripts/build-python-dist new file mode 100755 index 0000000..fccffaf --- /dev/null +++ b/scripts/build-python-dist @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +uv build From 8ad28c44a98a17555da6b08688f554bcb5a4409c Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Sun, 17 May 2026 22:58:32 +0200 Subject: [PATCH 2/3] bump --- .github/workflows/build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 6ab625f..7325ee5 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -23,7 +23,7 @@ jobs: ./scripts/build-python-dist - name: Upload binary - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: python-dist path: dist/ @@ -65,7 +65,7 @@ jobs: run: mv dist/pferd* dist/pferd-${{ matrix.os }} - name: Upload binary - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: pferd-${{ matrix.os }} path: dist/pferd-${{ matrix.os }} From 5402b8a14bbc708a866687983c1677e54715e10e Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Sun, 17 May 2026 23:03:39 +0200 Subject: [PATCH 3/3] WIP --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab05b1e..7857e1f 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The use of [venv](https://docs.python.org/3/library/venv.html) is recommended. ### With package managers -Packages are available for: +Unofficial packages are available for: - [AUR](https://aur.archlinux.org/packages/pferd) - [brew](https://formulae.brew.sh/formula/pferd) - [conda-forge](https://github.com/conda-forge/pferd-feedstock)