Skip to content

Commit

Permalink
Merge branch 'rust-nostr:master' into feat/nip-22
Browse files Browse the repository at this point in the history
  • Loading branch information
reyamir authored Oct 31, 2024
2 parents 219e13f + 06e37f3 commit ab621e4
Show file tree
Hide file tree
Showing 383 changed files with 15,735 additions and 9,021 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/publish-python.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Publish nostr-protocol to PyPI

on: [workflow_dispatch]
on:
workflow_dispatch:
inputs:
dry-run:
description: "Compile without publish to PyPI"
type: boolean
default: false
required: true

jobs:
build-linux-x86_64:
Expand All @@ -19,13 +26,14 @@ jobs:
container:
image: quay.io/pypa/manylinux_2_28_x86_64
env:
PLAT: manylinux_2_28_x86_64
PYBIN: "/opt/python/${{ matrix.python }}/bin"
steps:
- name: "Checkout"
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
# Needed because inside container
- name: "Setup Rust"
uses: actions-rs/toolchain@v1
with:
toolchain: stable

Expand All @@ -35,9 +43,9 @@ jobs:
- name: "Build wheel"
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 --verbose

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nostr_sdk-manylinux_2_28_x86_64-${{ matrix.python }}
name: nostr_protocol-manylinux_2_28_x86_64-${{ matrix.python }}
path: /home/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl

build-linux-aarch64:
Expand All @@ -48,15 +56,11 @@ jobs:
python: ["3.9", "3.10", "3.11", "3.12"]
defaults:
run:
working-directory: bindings/nostr-ffi/bindings-python
working-directory: bindings/nostr-ffi/bindings-python
steps:
- name: "Checkout"
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: "Setup Python"
uses: actions/setup-python@v4
with:
Expand All @@ -66,14 +70,14 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: "Generate nostr.py and binaries"
run: bash ./scripts/generate-linux-aarch64.sh

- name: "Build wheel"
run: python3 setup.py bdist_wheel --plat-name manylinux_2_31_aarch64 --verbose

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nostr_protocol-manylinux_2_31_aarch64-${{ matrix.python }}
path: /home/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl
Expand Down Expand Up @@ -107,7 +111,7 @@ jobs:
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nostr_protocol-macos-arm64-${{ matrix.python }}
path: /Users/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl
Expand Down Expand Up @@ -140,7 +144,7 @@ jobs:
# see issue #350 for more information
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nostr_protocol-macos-x86_64-${{ matrix.python }}
path: /Users/runner/work/nostr/nostr/bindings/nostr-ffi/bindings-python/dist/*.whl
Expand Down Expand Up @@ -170,7 +174,7 @@ jobs:
run: python setup.py bdist_wheel --verbose

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nostr_protocol-win-${{ matrix.python }}
path: D:\a\nostr\nostr\bindings\nostr-ffi\bindings-python\dist\*.whl
Expand All @@ -182,12 +186,13 @@ jobs:
run:
working-directory: bindings/nostr-ffi/bindings-python
needs: [build-linux-x86_64, build-linux-aarch64, build-macos-arm64, build-macos-x86_64, build-windows]
if: github.event.inputs.dry-run == 'false'
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Download artifacts in dist/ directory"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: dist/

Expand Down
35 changes: 20 additions & 15 deletions .github/workflows/publish-sdk-python.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Publish nostr-sdk to PyPI

on: [workflow_dispatch]
on:
workflow_dispatch:
inputs:
dry-run:
description: "Compile without publish to PyPI"
type: boolean
default: false
required: true

jobs:
build-linux-x86_64:
Expand All @@ -19,13 +26,14 @@ jobs:
container:
image: quay.io/pypa/manylinux_2_28_x86_64
env:
PLAT: manylinux_2_28_x86_64
PYBIN: "/opt/python/${{ matrix.python }}/bin"
steps:
- name: "Checkout"
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
# Needed because inside container
- name: "Setup Rust"
uses: actions-rs/toolchain@v1
with:
toolchain: stable

Expand All @@ -35,7 +43,7 @@ jobs:
- name: "Build wheel"
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 --verbose

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nostr_sdk-manylinux_2_28_x86_64-${{ matrix.python }}
path: /home/runner/work/nostr/nostr/bindings/nostr-sdk-ffi/bindings-python/dist/*.whl
Expand All @@ -48,15 +56,11 @@ jobs:
python: ["3.9", "3.10", "3.11", "3.12"]
defaults:
run:
working-directory: bindings/nostr-sdk-ffi/bindings-python
working-directory: bindings/nostr-sdk-ffi/bindings-python
steps:
- name: "Checkout"
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: "Setup Python"
uses: actions/setup-python@v4
with:
Expand All @@ -66,14 +70,14 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: "Generate nostr_sdk.py and binaries"
run: bash ./scripts/generate-linux-aarch64.sh

- name: "Build wheel"
run: python3 setup.py bdist_wheel --plat-name manylinux_2_31_aarch64 --verbose

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nostr_sdk-manylinux_2_31_aarch64-${{ matrix.python }}
path: /home/runner/work/nostr/nostr/bindings/nostr-sdk-ffi/bindings-python/dist/*.whl
Expand Down Expand Up @@ -107,7 +111,7 @@ jobs:
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nostr_sdk-macos-arm64-${{ matrix.python }}
path: /Users/runner/work/nostr/nostr/bindings/nostr-sdk-ffi/bindings-python/dist/*.whl
Expand Down Expand Up @@ -140,7 +144,7 @@ jobs:
# see issue #350 for more information
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nostr_sdk-macos-x86_64-${{ matrix.python }}
path: /Users/runner/work/nostr/nostr/bindings/nostr-sdk-ffi/bindings-python/dist/*.whl
Expand Down Expand Up @@ -170,7 +174,7 @@ jobs:
run: python setup.py bdist_wheel --verbose

- name: "Upload artifacts"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: nostr_sdk-win-${{ matrix.python }}
path: D:\a\nostr\nostr\bindings\nostr-sdk-ffi\bindings-python\dist\*.whl
Expand All @@ -182,12 +186,13 @@ jobs:
run:
working-directory: bindings/nostr-sdk-ffi/bindings-python
needs: [build-linux-x86_64, build-linux-aarch64, build-macos-arm64, build-macos-x86_64, build-windows]
if: github.event.inputs.dry-run == 'false'
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Download artifacts in dist/ directory"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: dist/

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ many-events.json
many-events.json.zst
.idea/
.vscode/
env/
Loading

0 comments on commit ab621e4

Please sign in to comment.