Skip to content

Commit 8a2586b

Browse files
committed
CI&CD: upgrading publish workflow logic to best ever
1 parent 8c4bb58 commit 8a2586b

File tree

5 files changed

+21
-32
lines changed

5 files changed

+21
-32
lines changed

.github/workflows/publish-pypi-pi_heif.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ name: Publish • Pi-Heif
22
# This action build `pi-heif` which is `pillow-heif` but without `aom` and `x265` libraries.
33

44
on:
5-
workflow_run:
6-
workflows: [Publish • Pillow-Heif]
7-
types:
8-
- completed
5+
workflow_call:
96

107
jobs:
118
wheels_macos_arm:
12-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
139
name: macosx • aarch64
1410
runs-on: ubuntu-20.04
1511

@@ -35,7 +31,6 @@ jobs:
3531
if-no-files-found: error
3632

3733
wheels_windows:
38-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
3934
name: windows • x86_64
4035
runs-on: windows-2019
4136
env:
@@ -89,7 +84,6 @@ jobs:
8984
if-no-files-found: error
9085

9186
wheels_macos:
92-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
9387
name: macosx • x86_64
9488
runs-on: macos-11
9589

@@ -121,7 +115,6 @@ jobs:
121115
if-no-files-found: error
122116

123117
wheels_linux_cpython:
124-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
125118
strategy:
126119
fail-fast: true
127120
matrix:
@@ -152,6 +145,10 @@ jobs:
152145
env:
153146
OS_PACKAGES: "fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"
154147

148+
- name: Only minimal testing on aarch64
149+
if: matrix.cibw_arch == 'aarch64'
150+
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
151+
155152
- name: Run cibuildwheel
156153
run: |
157154
python3 -m pip install cibuildwheel==2.11.4
@@ -175,7 +172,6 @@ jobs:
175172
if-no-files-found: error
176173

177174
wheels_linux_pypy:
178-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
179175
strategy:
180176
fail-fast: true
181177
matrix:
@@ -201,6 +197,10 @@ jobs:
201197
with:
202198
platforms: arm64
203199

200+
- name: Only minimal testing on aarch64
201+
if: matrix.cibw_arch == 'aarch64'
202+
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
203+
204204
- name: Run cibuildwheel
205205
run: |
206206
python3 -m pip install cibuildwheel==2.11.4
@@ -224,7 +224,6 @@ jobs:
224224
if-no-files-found: error
225225

226226
wheels_armv7l:
227-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
228227
name: ${{ matrix.i['name'] }} • ARMv7l • CPython
229228
runs-on: ubuntu-20.04
230229
strategy:
@@ -267,7 +266,6 @@ jobs:
267266
if-no-files-found: error
268267

269268
sdist:
270-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
271269
name: Source distribution
272270
runs-on: macos-12
273271

@@ -311,7 +309,6 @@ jobs:
311309
path: wheelhouse/*.tar.gz
312310

313311
publish_release:
314-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
315312
needs: [wheels_windows, wheels_macos, wheels_macos_arm, wheels_linux_cpython, wheels_linux_pypy, sdist, wheels_armv7l]
316313
name: Publish release
317314
runs-on: ubuntu-20.04

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Publish • Pillow-Heif
22

33
on:
4-
workflow_run:
5-
workflows: [Publish]
6-
types:
7-
- completed
4+
workflow_call:
85

96
jobs:
107
wheels_macos_arm:
@@ -232,10 +229,6 @@ jobs:
232229
env:
233230
OS_PACKAGES: "fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"
234231

235-
- name: Only minimal testing on aarch64
236-
if: matrix.cibw_arch == 'aarch64'
237-
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
238-
239232
- uses: actions/cache@v3
240233
with:
241234
path: ${{ env.BUILD_DIR_PREFIX }}/build-stuff
@@ -348,10 +341,6 @@ jobs:
348341
with:
349342
platforms: arm64
350343

351-
- name: Only minimal testing on aarch64
352-
if: matrix.cibw_arch == 'aarch64'
353-
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
354-
355344
- uses: actions/cache@v3
356345
with:
357346
path: ${{ env.BUILD_DIR_PREFIX }}/build-stuff

.github/workflows/publish-wheels.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ on:
55
branches: [ master ]
66

77
jobs:
8-
publish_wheels:
9-
name: Publish triggered
8+
trigger_pillow_heif_build:
109
if: "contains(github.event.head_commit.message, '[publish]')"
11-
runs-on: ubuntu-20.04
10+
name: Pillow-Heif
11+
uses: ./.github/workflows/publish-pypi.yml
1212

13-
steps:
14-
- run: echo "Publish triggered"
13+
trigger_pi_heif_build:
14+
needs: [trigger_pillow_heif_build]
15+
if: "contains(github.event.head_commit.message, '[publish]')"
16+
name: Pi-Heif
17+
uses: ./.github/workflows/publish-pypi-pi_heif.yml

.github/workflows/test-wheels-pi_heif.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Wheels test(Pi-Heif)
1+
name: Wheels testPi-Heif
22

33
on:
44
workflow_dispatch:
55
workflow_run:
6-
workflows: [Publish • Pi-Heif]
6+
workflows: [Publish]
77
types:
88
- completed
99

.github/workflows/test-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Wheels test
33
on:
44
workflow_dispatch:
55
workflow_run:
6-
workflows: [Publish • Pillow-Heif]
6+
workflows: [Publish]
77
types:
88
- completed
99

0 commit comments

Comments
 (0)