-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (61 loc) · 2.19 KB
/
build-wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build source and wheel packages
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-13, macos-14, ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
if: startsWith(matrix.os, 'ubuntu-')
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
- name: Set up Python
if: startsWith(matrix.os, 'macos')
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-build-wheels-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-wheels-
- name: Install required system packages for macOS
if: startsWith(matrix.os, 'macos-')
run: |
brew update
brew tap cuber/homebrew-libsecp256k1
brew install libsecp256k1
- name: Install required system packages only for Ubuntu Linux
if: startsWith(matrix.os, 'ubuntu-')
run: |
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y libsecp256k1-dev
- name: Install Hatch
run: |
python3 -m venv /tmp/venv
/tmp/venv/bin/python3 -m pip install --upgrade hatch
- name: Build source and wheel packages
run: |
/tmp/venv/bin/python3 -m hatch build
- name: Install the Python wheel
run: |
/tmp/venv/bin/python3 -m pip install dist/aleph_sdk_python-*.whl
- name: Install `setuptools` on systems where it is missing by default
run: /tmp/venv/bin/python3 -m pip install --upgrade setuptools
if: matrix.os == 'ubuntu-24.04'
- name: Import and use the package
run: |
/tmp/venv/bin/python3 -c "import aleph.sdk"
/tmp/venv/bin/python3 -c "from aleph.sdk.chains.ethereum import get_fallback_account; get_fallback_account()"