Skip to content

Commit 6cdea46

Browse files
committed
ok or what
1 parent 9fbb9df commit 6cdea46

File tree

1 file changed

+81
-115
lines changed

1 file changed

+81
-115
lines changed

.github/workflows/maturin.yml

Lines changed: 81 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -11,139 +11,105 @@ permissions:
1111

1212
jobs:
1313

14-
# linux:
15-
# runs-on: ${{ matrix.platform.runner }}
16-
# strategy:
17-
# matrix:
18-
# platform:
19-
# - runner: ubuntu-22.04
20-
# target: x86_64
21-
# steps:
22-
# - uses: actions/checkout@v4
23-
# - uses: actions/setup-python@v5
24-
# with:
25-
# python-version: 3.x
26-
# - name: Build wheels
27-
# uses: PyO3/maturin-action@v1
28-
# with:
29-
# target: ${{ matrix.platform.target }}
30-
# args: --release --out dist --find-interpreter
31-
# manylinux: 2_28
32-
# before-script-linux: |
33-
# set -ex
34-
# dnf install -y epel-release && dnf update -y
35-
# dnf install -y gcc gcc-c++ make perl curl openssl-devel pkgconfig clang xz-devel
36-
# export OPENSSL_LIB_DIR=$(pkg-config --variable=libdir openssl)
37-
# export OPENSSL_INCLUDE_DIR=$(pkg-config --variable=includedir openssl)
38-
# if [ -z "$OPENSSL_LIB_DIR" ] || [ -z "$OPENSSL_INCLUDE_DIR" ]; then
39-
# echo "OpenSSL development files are not installed or pkg-config is not configured correctly."
40-
# exit 1
41-
# fi
42-
# export OPENSSL_DIR="$OPENSSL_LIB_DIR/ssl"
43-
# export OPENSSL_NO_VENDOR=1
44-
# - name: Upload wheels
45-
# uses: actions/upload-artifact@v4
46-
# with:
47-
# name: wheels-linux-${{ matrix.platform.target }}
48-
# path: dist
49-
50-
windows:
14+
linux:
5115
runs-on: ${{ matrix.platform.runner }}
5216
strategy:
5317
matrix:
5418
platform:
55-
- runner: windows-latest
56-
target: x64
57-
- runner: windows-latest
58-
target: x86
19+
- runner: ubuntu-22.04
20+
target: x86_64
5921
steps:
6022
- uses: actions/checkout@v4
6123
- uses: actions/setup-python@v5
6224
with:
6325
python-version: 3.x
64-
architecture: ${{ matrix.platform.target }}
65-
- name: Install OpenSSL
66-
run: |
67-
choco install openssl
68-
$env:OPENSSL_DIR = "C:\Program Files\OpenSSL-Win64"
69-
$env:OPENSSL_INCLUDE_DIR = "$env:OPENSSL_DIR\include"
70-
$env:OPENSSL_LIB_DIR = "$env:OPENSSL_DIR\lib"
7126
- name: Build wheels
7227
uses: PyO3/maturin-action@v1
73-
env:
74-
RUST_BACKTRACE: 1
7528
with:
7629
target: ${{ matrix.platform.target }}
7730
args: --release --out dist --find-interpreter
31+
manylinux: 2_28
32+
before-script-linux: |
33+
set -ex
34+
dnf install -y epel-release && dnf update -y
35+
dnf install -y gcc gcc-c++ make perl curl openssl-devel pkgconfig clang xz-devel
36+
export OPENSSL_LIB_DIR=$(pkg-config --variable=libdir openssl)
37+
export OPENSSL_INCLUDE_DIR=$(pkg-config --variable=includedir openssl)
38+
if [ -z "$OPENSSL_LIB_DIR" ] || [ -z "$OPENSSL_INCLUDE_DIR" ]; then
39+
echo "OpenSSL development files are not installed or pkg-config is not configured correctly."
40+
exit 1
41+
fi
42+
export OPENSSL_DIR="$OPENSSL_LIB_DIR/ssl"
43+
export OPENSSL_NO_VENDOR=1
7844
- name: Upload wheels
7945
uses: actions/upload-artifact@v4
8046
with:
81-
name: wheels-windows-${{ matrix.platform.target }}
47+
name: wheels-linux-${{ matrix.platform.target }}
8248
path: dist
8349

84-
# macos:
85-
# runs-on: ${{ matrix.platform.runner }}
86-
# strategy:
87-
# matrix:
88-
# platform:
89-
# - runner: macos-13
90-
# target: x86_64
91-
# - runner: macos-14
92-
# target: aarch64
93-
# steps:
94-
# - uses: actions/checkout@v4
95-
# - uses: actions/setup-python@v5
96-
# with:
97-
# python-version: 3.x
98-
# - name: Build wheels
99-
# uses: PyO3/maturin-action@v1
100-
# with:
101-
# target: ${{ matrix.platform.target }}
102-
# args: --release --out dist --find-interpreter
103-
# - name: Upload wheels
104-
# uses: actions/upload-artifact@v4
105-
# with:
106-
# name: wheels-macos-${{ matrix.platform.target }}
107-
# path: dist
50+
macos:
51+
runs-on: ${{ matrix.platform.runner }}
52+
strategy:
53+
matrix:
54+
platform:
55+
- runner: macos-13
56+
target: x86_64
57+
- runner: macos-14
58+
target: aarch64
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-python@v5
62+
with:
63+
python-version: 3.x
64+
- name: Build wheels
65+
uses: PyO3/maturin-action@v1
66+
with:
67+
target: ${{ matrix.platform.target }}
68+
args: --release --out dist --find-interpreter
69+
- name: Upload wheels
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: wheels-macos-${{ matrix.platform.target }}
73+
path: dist
10874

109-
# sdist:
110-
# runs-on: ubuntu-latest
111-
# steps:
112-
# - uses: actions/checkout@v4
113-
# - name: Build sdist
114-
# uses: PyO3/maturin-action@v1
115-
# with:
116-
# command: sdist
117-
# args: --out dist
118-
# - name: Upload sdist
119-
# uses: actions/upload-artifact@v4
120-
# with:
121-
# name: wheels-sdist
122-
# path: dist
75+
sdist:
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
- name: Build sdist
80+
uses: PyO3/maturin-action@v1
81+
with:
82+
command: sdist
83+
args: --out dist
84+
- name: Upload sdist
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: wheels-sdist
88+
path: dist
12389

124-
# release:
125-
# name: Release
126-
# runs-on: ubuntu-latest
127-
# if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
128-
# needs: [linux, windows, macos, sdist]
129-
# permissions:
130-
# # Use to sign the release artifacts
131-
# id-token: write
132-
# # Used to upload release artifacts
133-
# contents: write
134-
# # Used to generate artifact attestation
135-
# attestations: write
136-
# steps:
137-
# - uses: actions/download-artifact@v4
138-
# - name: Generate artifact attestation
139-
# uses: actions/attest-build-provenance@v1
140-
# with:
141-
# subject-path: 'wheels-*/*'
142-
# - name: Publish to PyPI
143-
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
144-
# uses: PyO3/maturin-action@v1
145-
# env:
146-
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
147-
# with:
148-
# command: upload
149-
# args: --non-interactive --skip-existing wheels-*/*
90+
release:
91+
name: Release
92+
runs-on: ubuntu-latest
93+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
94+
needs: [linux, windows, macos, sdist]
95+
permissions:
96+
# Use to sign the release artifacts
97+
id-token: write
98+
# Used to upload release artifacts
99+
contents: write
100+
# Used to generate artifact attestation
101+
attestations: write
102+
steps:
103+
- uses: actions/download-artifact@v4
104+
- name: Generate artifact attestation
105+
uses: actions/attest-build-provenance@v1
106+
with:
107+
subject-path: 'wheels-*/*'
108+
- name: Publish to PyPI
109+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
110+
uses: PyO3/maturin-action@v1
111+
env:
112+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
113+
with:
114+
command: upload
115+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)