-
Notifications
You must be signed in to change notification settings - Fork 52
87 lines (68 loc) · 2.26 KB
/
nightly_release.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
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
name: Build and Release (nightly)
on:
schedule:
# 10 am UTC is 3am or 4am PT depending on daylight savings.
- cron: "0 10 * * *"
workflow_dispatch: {}
jobs:
run-unittests-python:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'google-ai-edge/ai-edge-torch')
name: Unit Tests Python
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.sha }}
run-on-macos: true
build-and-release-nightly:
needs: run-unittests-python
runs-on: ubuntu-latest
name: Build and Release ai-edge-torch-nightly
steps:
- uses: actions/checkout@v4
- name: Get and set nightly date
id: date
run: |
DATE=$(date +'%Y%m%d')
echo "NIGHTLY_RELEASE_DATE=${DATE}" >> $GITHUB_ENV
echo "date=${DATE}" >> $GITHUB_OUTPUT
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install python-build and twine
run: |
python -m pip install --upgrade pip
python -m pip install build twine wheel
python -m pip list
- name: Build the wheel
run: |
python setup.py bdist_wheel
- name: Verify the distribution
run: twine check --strict dist/*
- name: List the contents of ai_edge_torch wheel
run: python -m zipfile --list dist/*.whl
- name: Upload to PyPI
run: twine upload dist/* --non-interactive -p ${{ secrets.PYPI_UPLOAD_TOKEN }}
run-pip-install-and-import-test:
needs: build-and-release-nightly
strategy:
matrix:
python-version: ["3.10", "3.11"]
name: Test Install and Import ai-edge-torch
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: |
python -m pip cache purge
python -m pip install --upgrade pip
- name: Install ai-edge-torch-nightly
run: |
python -m pip install ai-edge-torch-nightly
- name: Import ai-edge-torch
run: |
python -c "import ai_edge_torch"