Skip to content

Update quick start module #1740

Update quick start module

Update quick start module #1740

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
- scripts/gen_additional_platforms.py
- _includes/quick-start-module.js
- _includes/quick_start_local.html
- _additional_platforms/*.json
- _get_started/additional_platforms/*.md
push:
branches:
site
paths:
- .github/workflows/update-quick-start-module.yml
- scripts/gen_quick_start_module.py
- scripts/gen_additional_platforms.py
- _includes/quick-start-module.js
- _includes/quick_start_local.html
- _additional_platforms/*.json
- _get_started/additional_platforms/*.md
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"
getting-started: true
windows-nightly-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: all
os: windows
channel: "nightly"
getting-started: true
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"
getting-started: true
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"
getting-started: true
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"
getting-started: true
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"
getting-started: true
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-latest"
environment: pytorchbot-env
steps:
- name: Checkout pytorch.github.io
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
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 Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PYTORCHBOT_TOKEN }}
commit-message: Modify published_versions.json, releases.json and quick-start-module.js
title: '[Getting Started Page] Modify published_versions.json, releases.json and quick-start-module.js'
body: >
This PR is auto-generated. It updates Getting Started page
labels: automated pr
update-additional-platform:
runs-on: "ubuntu-latest"
environment: pytorchbot-env
steps:
- name: Checkout pytorch.github.io
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: 3.9
architecture: x64
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install markdown pygments
- name: Generate additional-platforms assets
shell: bash
run: |
set -ex
python3 ./scripts/gen_additional_platforms.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
token: ${{ secrets.PYTORCHBOT_TOKEN }}
commit-message: Regenerate additional-platforms assets
title: '[Additional Platforms] Regenerate quick-start-additional-platforms.js and additional-platforms.json'
body: >
This PR is auto-generated. It regenerates the third-party vendor
accelerator picker assets after a change to _additional_platforms/*.json
or _get_started/additional_platforms/*.md.
labels: automated pr
add-paths: |
assets/quick-start-additional-platforms.js
additional-platforms.json