Skip to content

Commit 09109c2

Browse files
authored
Separate build and upload jobs (#6)
* Split into build and release => multi-image build * Run pre-release for PRs
1 parent 28a07ad commit 09109c2

File tree

2 files changed

+47
-15
lines changed

2 files changed

+47
-15
lines changed

.github/workflows/build-and-prelease.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
name: Build and pre-release on GitHub
22

3-
on:
4-
push:
5-
branches: [ main ]
3+
on: push
64

75
jobs:
8-
build_and_release_wheels_x86_64:
6+
build_wheels_x86_64:
97
runs-on: ubuntu-latest
10-
container:
11-
image: quay.io/pypa/manylinux_2_24_x86_64
128
strategy:
139
fail-fast: false
10+
matrix:
11+
image-name:
12+
- manylinux2014_x86_64
13+
- manylinux_2_24_x86_64
14+
container:
15+
image: quay.io/pypa/${{ matrix.image-name }}
1416
steps:
1517
- name: Check out repo and submodule repos
1618
uses: actions/checkout@v2
@@ -32,7 +34,7 @@ jobs:
3234
- name: Skim Rust build cache
3335
uses: actions/cache@v2
3436
env:
35-
cache-name: cache-skim-build
37+
cache-name: cache-skim-build-${{ matrix.image-name }}
3638
with:
3739
path: skim-fork/target
3840
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('skim-fork/**/*') }}
@@ -66,14 +68,27 @@ jobs:
6668
mv dist dist_unaudited
6769
mkdir dist
6870
for whl in dist_unaudited/*.whl; do
69-
auditwheel repair "$whl" -w dist/
71+
auditwheel repair "$whl" --plat "${{ matrix.image-name }}" -w dist/
7072
done
7173
- name: Upload wheels as artifacts
7274
uses: actions/upload-artifact@v2
7375
with:
74-
name: wheels
76+
name: wheels-${{ matrix.image-name }}
7577
path: |
7678
dist
79+
pre_release_wheels_x86_64:
80+
needs: build_wheels_x86_64
81+
runs-on: ubuntu-latest
82+
container:
83+
image: quay.io/pypa/manylinux_2_24_x86_64
84+
steps:
85+
- name: Download all wheel artifacts
86+
uses: actions/download-artifact@v3
87+
with:
88+
path: dist
89+
- name: Move wheel artifacts
90+
run: |
91+
cd dist && mv */*.whl ./
7792
- name: Publish as GitHub pre-release
7893
uses: "marvinpinto/action-automatic-releases@latest"
7994
with:

.github/workflows/build-and-release.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ on:
66
- "[0-9].*"
77

88
jobs:
9-
build_and_release_wheels_x86_64:
9+
build_wheels_x86_64:
1010
runs-on: ubuntu-latest
11-
container:
12-
image: quay.io/pypa/manylinux_2_24_x86_64
1311
strategy:
1412
fail-fast: false
13+
matrix:
14+
image-name:
15+
- manylinux2014_x86_64
16+
- manylinux_2_24_x86_64
17+
container:
18+
image: quay.io/pypa/${{ matrix.image-name }}
1519
steps:
1620
- name: Check out repo and submodule repos
1721
uses: actions/checkout@v2
@@ -33,7 +37,7 @@ jobs:
3337
- name: Skim Rust build cache
3438
uses: actions/cache@v2
3539
env:
36-
cache-name: cache-skim-build
40+
cache-name: cache-skim-build-${{ matrix.image-name }}
3741
with:
3842
path: skim-fork/target
3943
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('skim-fork/**/*') }}
@@ -67,14 +71,27 @@ jobs:
6771
mv dist dist_unaudited
6872
mkdir dist
6973
for whl in dist_unaudited/*.whl; do
70-
auditwheel repair "$whl" -w dist/
74+
auditwheel repair "$whl" --plat "${{ matrix.image-name }}" -w dist/
7175
done
7276
- name: Upload wheels as artifacts
7377
uses: actions/upload-artifact@v2
7478
with:
75-
name: wheels
79+
name: wheels-${{ matrix.image-name }}
7680
path: |
7781
dist
82+
release_wheels_x86_64:
83+
needs: build_wheels_x86_64
84+
runs-on: ubuntu-latest
85+
container:
86+
image: quay.io/pypa/manylinux_2_24_x86_64
87+
steps:
88+
- name: Download all wheel artifacts
89+
uses: actions/download-artifact@v3
90+
with:
91+
path: dist
92+
- name: Move wheel artifacts
93+
run: |
94+
cd dist && mv */*.whl ./
7895
- name: Publish as GitHub release
7996
uses: "marvinpinto/action-automatic-releases@latest"
8097
with:

0 commit comments

Comments
 (0)