forked from pytorch/ao
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename nightly-build.yml to build.yml (pytorch#240)
* Update and rename nightly-build.yml to build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml
- Loading branch information
Showing
2 changed files
with
59 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: PyPI Nightly Build | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Runs at midnight UTC every day | ||
workflow_dispatch: | ||
inputs: | ||
build-type: | ||
description: 'Choose build type: nightly or release' | ||
required: true | ||
default: 'release' | ||
options: | ||
- nightly | ||
- release | ||
ref: | ||
description: 'Branch or tag name' | ||
required: false | ||
default: 'main' | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
pip install -r requirements.txt | ||
- name: Build package | ||
run: | | ||
if [ "${{ github.event_name }}" = "schedule" ]; then | ||
export TORCHAO_NIGHTLY=1 | ||
elif [ "${{ github.event.inputs['build-type'] }}" = "nightly" ]; then | ||
export TORCHAO_NIGHTLY=1 | ||
fi | ||
pip install . | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
repository_url: https://upload.pypi.org/legacy/ | ||
packages_dir: dist/ | ||
|
||
- name: Open issue on failure | ||
if: ${{ failure() && github.event_name == 'schedule' }} | ||
uses: dacbd/create-issue-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: Nightly Build failed | ||
body: Commit ${{ github.sha }} daily scheduled [CI run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed, please check why | ||
assignees: '' |
This file was deleted.
Oops, something went wrong.