Skip to content

Commit ee0cba9

Browse files
Cycloctanewebknjaz
authored andcommitted
update ci-cd
1 parent 1158883 commit ee0cba9

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/ci-cd.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,25 @@ env:
2323
FORCE_COLOR: 1 # Request colored output from CLI tools supporting it
2424
MYPY_FORCE_COLOR: 1
2525
PY_COLORS: 1
26+
UPSTREAM_REPOSITORY_ID: |
27+
13258039
2628
2729
permissions: {}
30+
2831
jobs:
2932

33+
pre-setup:
34+
name: Pre-Setup global build settings
35+
runs-on: ubuntu-latest
36+
outputs:
37+
upstream-repository-id: ${{ env.UPSTREAM_REPOSITORY_ID }}
38+
release-requested: |
39+
${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
40+
steps:
41+
- name: Dummy
42+
run: |
43+
echo "Pre-setup step"
44+
3045
lint:
3146
permissions:
3247
contents: read # to fetch code (actions/checkout)
@@ -259,9 +274,9 @@ jobs:
259274

260275
benchmark:
261276
name: Benchmark
262-
needs: gen_llhttp
263-
if: github.repository_id == '13258039'
264-
277+
needs: [pre-setup, gen_llhttp]
278+
if: |
279+
needs.pre-setup.outputs.upstream-repository-id == github.repository_id
265280
runs-on: ubuntu-latest
266281
timeout-minutes: 12
267282
steps:
@@ -318,9 +333,8 @@ jobs:
318333
pre-deploy:
319334
name: Pre-Deploy
320335
runs-on: ubuntu-latest
321-
needs: check
322-
# Run only on pushing a tag
323-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
336+
needs: [pre-setup, check]
337+
if: fromJSON(needs.pre-setup.outputs.release-requested)
324338
steps:
325339
- name: Dummy
326340
run: |
@@ -466,8 +480,10 @@ jobs:
466480

467481
deploy:
468482
name: Deploy
469-
needs: [build-tarball, build-wheels]
483+
needs: [pre-setup, build-tarball, build-wheels]
470484
runs-on: ubuntu-latest
485+
if: |
486+
needs.pre-setup.outputs.upstream-repository-id == github.repository_id
471487
472488
permissions:
473489
contents: write # IMPORTANT: mandatory for making GitHub Releases

0 commit comments

Comments
 (0)