Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: python-dist
path: dist/

build:
runs-on: ${{ matrix.os }}
Expand All @@ -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 }}

Expand All @@ -45,19 +65,24 @@ jobs:
run: mv dist/pferd* dist/pferd-${{ matrix.os }}

- name: Upload binary
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pferd-${{ matrix.os }}
path: dist/pferd-${{ matrix.os }}

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
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
5 changes: 5 additions & 0 deletions scripts/build-python-dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -e

uv build
Loading