-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (42 loc) · 1.34 KB
/
deploy-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
name: deploy-nightly
# Adapted from PreTeXt CLI
on:
schedule:
# * is a special character in YAML so you have to quote this string.
- cron: "23 5 * * *"
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
deploy:
name: Deploy to pypi
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- uses: actions/checkout@v4
# Sets up python3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
# Setup poetry
- name: Install poetry 1.8.3
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install poetry==1.8.3
- name: Install dependencies
shell: bash
run: python -m poetry install
- name: Run prep_nightly script and publish if ready
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
echo "Updating version number"
output=$(poetry run python scripts/prep_nightly.py)
echo "Completed nightly prep"
echo "Output: $output"
if [[ $output == *"OK to deploy"* ]]; then
poetry build
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish
echo "Published to pypi.org"
fi