Skip to content

Commit db491c1

Browse files
committed
add linux build
1 parent d449471 commit db491c1

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

Diff for: .github/workflows/cd.yml

+45-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '*'
99

1010
jobs:
11-
build:
11+
build-on-windows:
1212
name: Build distribution 📦
1313
runs-on: windows-latest
1414

@@ -51,6 +51,50 @@ jobs:
5151
name: python-package-distributions
5252
path: dist/
5353

54+
build-on-linux:
55+
name: Build distribution 📦
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Set up Python
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: "3.x"
64+
- name: Install pypa/build
65+
run: |
66+
python -m pip install --upgrade pip
67+
pip install setuptools wheel twine build
68+
- name: Build a binary wheel and a source tarball
69+
run: python3 -m build --wheel
70+
- name: Rename the distribution files
71+
run: |
72+
# Navigate to the dist directory
73+
cd dist
74+
75+
# Loop over every .whl file
76+
for oldname in *.whl
77+
do
78+
# Split the filename by "-"
79+
IFS='-' read -ra nameParts <<< "$oldname"
80+
81+
# Replace the third and fourth items by "py3"
82+
nameParts[2]="py3"
83+
nameParts[3]="py3"
84+
nameParts[4]="manylinux1"
85+
86+
# Assemble the new filename
87+
newName=$(IFS='-'; echo "${nameParts[*]}")
88+
89+
# Move the old file to the new filename
90+
mv "$oldname" "$newName"
91+
done
92+
93+
- name: Store the distribution packages
94+
uses: actions/upload-artifact@v3
95+
with:
96+
name: python-package-distributions
97+
path: dist/
5498
github-release:
5599
name: >-
56100
Sign the Python 🐍 distribution 📦 with Sigstore

0 commit comments

Comments
 (0)