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