-
Notifications
You must be signed in to change notification settings - Fork 291
112 lines (110 loc) · 4.18 KB
/
update-quick-start-module.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Update quick start module
on:
schedule:
# At 18:30 pm UTC (1:30 pm EST)
- cron: "30 18 * * *"
pull_request:
paths:
- .github/workflows/update-quick-start-module.yml
- scripts/gen_quick_start_module.py
- _includes/quick-start-module.js
- _includes/quick_start_local.html
push:
branches:
site
paths:
- .github/workflows/update-quick-start-module.yml
- scripts/gen_quick_start_module.py
- _includes/quick-start-module.js
- _includes/quick_start_local.html
workflow_dispatch:
jobs:
linux-nightly-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: linux
channel: "nightly"
windows-nightly-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: windows
channel: "nightly"
macos-arm64-nightly-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: macos-arm64
channel: "nightly"
linux-release-matrix:
needs: [linux-nightly-matrix]
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: linux
channel: "release"
windows-release-matrix:
needs: [windows-nightly-matrix]
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: windows
channel: "release"
macos-arm64-release-matrix:
needs: [macos-arm64-nightly-matrix]
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: macos-arm64
channel: "release"
update-quick-start:
needs: [linux-nightly-matrix, windows-nightly-matrix, macos-arm64-nightly-matrix,
linux-release-matrix, windows-release-matrix, macos-arm64-release-matrix]
runs-on: "ubuntu-20.04"
environment: pytorchbot-env
steps:
- name: Checkout builder
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
- name: Create json file
shell: bash
env:
LINUX_NIGHTLY_MATRIX: ${{ needs.linux-nightly-matrix.outputs.matrix }}
WINDOWS_NIGHTLY_MATRIX: ${{ needs.windows-nightly-matrix.outputs.matrix }}
MACOS_NIGHTLY_MATRIX: ${{ needs.macos-arm64-nightly-matrix.outputs.matrix }}
LINUX_RELEASE_MATRIX: ${{ needs.linux-release-matrix.outputs.matrix }}
WINDOWS_RELEASE_MATRIX: ${{ needs.windows-release-matrix.outputs.matrix }}
MACOS_RELEASE_MATRIX: ${{ needs.macos-arm64-release-matrix.outputs.matrix }}
run: |
set -ex
printf '%s\n' "$LINUX_NIGHTLY_MATRIX" > linux_nightly_matrix.json
printf '%s\n' "$WINDOWS_NIGHTLY_MATRIX" > windows_nightly_matrix.json
printf '%s\n' "$MACOS_NIGHTLY_MATRIX" > macos_nightly_matrix.json
printf '%s\n' "$LINUX_RELEASE_MATRIX" > linux_release_matrix.json
printf '%s\n' "$WINDOWS_RELEASE_MATRIX" > windows_release_matrix.json
printf '%s\n' "$MACOS_RELEASE_MATRIX" > macos_release_matrix.json
python3 ./scripts/gen_quick_start_module.py --autogenerate > assets/quick-start-module.js
rm *_matrix.json
- name: Create Issue if failed
uses: dacbd/create-issue-action@main
if: ${{ failure() }} # only run when this job is failed.
with:
title: Updating quick start module failed
token: ${{secrets.PYTORCHBOT_TOKEN}}
assignees: ${{github.actor}}
labels: bug
body: Updating quick start module failed, please fix update quick start module
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PYTORCHBOT_TOKEN }}
commit-message: Modify published_versions.json file
title: '[Getting Started Page] Modify published_versions.json file'
body: >
This PR is auto-generated. It updates Getting Started page
labels: automated pr