Skip to content

Commit 5fd2b5a

Browse files
authored
Create nightly-build.yml (#49)
* Create nightly-build.yml * Update nightly-build.yml * Trigger CI
1 parent 3980f9c commit 5fd2b5a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/nightly-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PyPI Nightly Build
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Runs at midnight UTC every day
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.x'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install setuptools wheel twine
21+
- name: Get current date
22+
id: date
23+
run: echo "::set-output name=date::$(date +'%Y%m%d')"
24+
- name: Build package
25+
run: |
26+
version=$(python setup.py --version)
27+
new_version="${version}.dev${{ steps.date.outputs.date }}"
28+
sed -i "s/version=.*/version='${new_version}',/" setup.py
29+
python setup.py sdist bdist_wheel
30+
- name: Publish package to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
user: __token__
34+
password: ${{ secrets.PYPI_API_TOKEN }}
35+
repository_url: https://pypi.org/project/torchao-nightly/
36+
packages_dir: dist/

0 commit comments

Comments
 (0)