1+ name : Upload Test for Pypi.
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ linux :
8+ runs-on : ubuntu-latest
9+
10+ strategy :
11+ matrix :
12+ target : [aarch64]
13+ steps :
14+ - uses : actions/checkout@v4
15+ - uses : actions/setup-python@v5
16+ with :
17+ python-version : " 3.10"
18+ cache : " pip"
19+ - run : pip install -r requirements.txt
20+ - name : Setup QEMU
21+ uses : docker/setup-qemu-action@v1
22+ if : ${{ matrix.target == 'aarch64' }}
23+ - name : Build wheels
24+ uses : PyO3/maturin-action@v1
25+ with :
26+ target : ${{ matrix.target }}
27+ maturin-version : " 1.2.0"
28+ args : --release --out dist --find-interpreter
29+ sccache : " true"
30+ manylinux : ${{ matrix.target == 'aarch64' && 'manylinux_2_28' || 'auto' }}
31+ before-script-linux : |
32+ pip install uniffi-bindgen==0.24.1
33+
34+ # ISSUE: https://github.com/sfackler/rust-openssl/issues/2036#issuecomment-1724324145
35+ # If we're running on rhel centos, install needed packages.
36+ if command -v yum &> /dev/null; then
37+ yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
38+
39+ # If we're running on i686 we need to symlink libatomic
40+ # in order to build openssl with -latomic flag.
41+ if [[ ! -d "/usr/lib64" ]]; then
42+ ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
43+ fi
44+ else
45+ # If we're running on debian-based system.
46+ apt update -y && apt-get install -y libssl-dev openssl pkg-config
47+ fi
48+ - name : Upload wheels
49+ uses : actions/upload-artifact@v4
50+ with :
51+ name : wheels-${{ matrix.target }}
52+ path : dist
53+
54+ sdist :
55+ runs-on : ubuntu-latest
56+
57+ steps :
58+ - uses : actions/checkout@v4
59+ - name : Build sdist
60+ uses : PyO3/maturin-action@v1
61+ with :
62+ command : sdist
63+ args : --out dist
64+ - name : Upload sdist
65+ uses : actions/upload-artifact@v4
66+ with :
67+ name : wheels
68+ path : dist
69+
70+ pypi-publish :
71+ name : upload release to PyPI
72+ runs-on : ubuntu-latest
73+ needs : [linux, sdist]
74+
75+ # Specifying a GitHub environment is optional, but strongly encouraged
76+ environment : testpublish
77+ permissions :
78+ # IMPORTANT: this permission is mandatory for Trusted Publishing
79+ id-token : write
80+ steps :
81+ # retrieve your distributions here
82+ - name : Checkout repository
83+ uses : actions/checkout@v4
84+
85+ - name : Download aarch64 wheels artifact
86+ uses : actions/download-artifact@v4
87+ with :
88+ name : wheels-aarch64
89+
90+ - name : Download sdist artifact
91+ uses : actions/download-artifact@v4
92+ with :
93+ name : sdist
94+
95+ - name : Publish package distributions to PyPI
96+ uses : pypa/gh-action-pypi-publish@release/v1
97+ with :
98+ repository-url : https://test.pypi.org/legacy/
0 commit comments