-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (72 loc) · 2.24 KB
/
wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Wheels building
on:
push:
pull_request:
types: [opened, reopened, ready_for_review]
issue_comment:
types: created
release:
types: released
schedule:
- cron: "30 1 * * 4"
workflow_dispatch:
jobs:
get_trigger_ref:
name: Get Head Ref of Triggering
if: >-
contains(github.event.head_commit.message, '[build]') ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'release' ||
github.event_name == 'pull_request' ||
(github.event.issue.pull_request && github.event.comment.body == '/build')
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
head_ref: ${{ steps.trigger_ref.outputs.value }}
steps:
- uses: haya14busa/action-cond@v1
id: pr_or_push_ref
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: ${{ github.event.pull_request.head.ref }}
if_false: ${{ github.ref_name }}
- uses: xt0rted/pull-request-comment-branch@v1
if: github.event_name == 'issue_comment'
id: pr_comment_ref
- uses: haya14busa/action-cond@v1
id: trigger_ref
with:
cond: ${{ github.event_name != 'issue_comment' }}
if_true: ${{ steps.pr_or_push_ref.outputs.value }}
if_false: ${{ steps.pr_comment_ref.outputs.head_ref }}
- name: Show Trigger REF
run: |
echo ${{ steps.trigger_ref.outputs.value }}
build_package:
needs: get_trigger_ref
uses: ./.github/workflows/build.yml
with:
ref: ${{ needs.get_trigger_ref.outputs.head_ref }}
need_wheel: true
run_tests:
needs: [get_trigger_ref, build_package]
uses: ./.github/workflows/test.yml
with:
ref: ${{ needs.get_trigger_ref.outputs.head_ref }}
os: Linux
python_version: "3.10"
secrets: inherit
update_PR_Comment:
needs: run_tests
if: github.event_name == 'pull_request'
uses: ./.github/workflows/comment.yml
pypa_publish:
needs: [build_package, run_tests]
uses: ./.github/workflows/publish_pypi.yml
if: needs.run_tests.outputs.test_passed
with:
is_release: ${{ github.event_name == 'release' }}
secrets: inherit