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