Skip to content

Commit

Permalink
Update and rename nightly-build.yml to build.yml (pytorch#240)
Browse files Browse the repository at this point in the history
* 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
msaroufim authored and lancerts committed May 17, 2024
1 parent 0cf842c commit 630d842
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 31 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
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: ''
31 changes: 0 additions & 31 deletions .github/workflows/nightly-build.yml

This file was deleted.

0 comments on commit 630d842

Please sign in to comment.