forked from pycaret/pycaret
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 1.77 KB
/
build_publish_nightly.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
# Written by Antoni Baum (Yard1)
# Make sure to set pypi_password secret
name: Build and publish pycaret-nightly
on:
schedule:
- cron: "0 0 * * *" # every 24 hours on midnight
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --user --upgrade setuptools wheel requests numpy
- name: Get check_latest_commit_for_nightly.py
run: |
curl "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/${GITHUB_REF##*/}/.github/CI/check_latest_commit_for_nightly.py" --output check_latest_commit_for_nightly.py --silent
- name: Check if it's necessary to continiue
run: |
set +e
REF_TO_CHECKOUT=$(python check_latest_commit_for_nightly.py "$GITHUB_REPOSITORY" "${GITHUB_REF##*/}")
if [[ $? -eq 0 ]] ; then
echo "Proceeding with build and publish of commit $REF_TO_CHECKOUT"
echo "REF_TO_CHECKOUT=$REF_TO_CHECKOUT" >> $GITHUB_ENV
else
echo "No need for build and publish, exiting..."
echo "REF_TO_CHECKOUT=0" >> $GITHUB_ENV
exit 0
fi
- name: Checkout last passing commit
if: env.REF_TO_CHECKOUT != '0'
uses: actions/checkout@v2
with:
ref: ${{ env.REF_TO_CHECKOUT }}
- name: Build nightly distribution
if: env.REF_TO_CHECKOUT != '0'
run: |
rm -rf dist/*
python setup_nightly.py sdist bdist_wheel
- name: Publish nightly distribution to PyPI
if: env.REF_TO_CHECKOUT != '0'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}