File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : deploy-nightly
2+
3+ on :
4+ schedule :
5+ # * is a special character in YAML so you have to quote this string.
6+ - cron : " 00 6 * * *"
7+ # Allows you to run this workflow manually from the Actions tab.
8+ workflow_dispatch :
9+ inputs :
10+ core-repo :
11+ description : " The repository to use for the core commit."
12+ required : false
13+ type : choice
14+ default : " PreTeXtbook/pretext"
15+ options :
16+ - " PreTeXtbook/pretext"
17+ - " oscarlevin/pretext"
18+
19+ jobs :
20+ tests :
21+ name : Run tests
22+ uses : ./.github/workflows/tests.yml
23+
24+ deploy :
25+ needs : tests
26+ name : Deploy to pypi
27+ runs-on : ubuntu-latest
28+ steps :
29+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
30+ - uses : actions/checkout@v4
31+
32+ # Sets up python3
33+ - uses : actions/setup-python@v4
34+ with :
35+ python-version : 3.12
36+
37+ # Setup poetry
38+ - name : Install poetry 1.8.4
39+ run : |
40+ python -m pip install --upgrade pip
41+ python -m pip install poetry==1.8.4
42+
43+ - name : Install build dependencies
44+ run : |
45+ sudo apt-get update
46+ sudo apt-get -y install python3-louis librsvg2-bin libcairo2-dev
47+
48+ - name : Install dependencies
49+ shell : bash
50+ run : python -m poetry install --all-extras
51+
52+ - name : Run prep-nightly script and publish if ready
53+ env :
54+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
55+ run : |
56+ echo "Updating core commit and version; building"
57+ output=$(poetry run python scripts/prep_nightly.py ${{ inputs.core-repo }})
58+ echo "Finished steps to prep nightly deployment"
59+ if [[ $output == *"Ready to deploy"* ]]; then
60+ poetry config pypi-token.pypi $PYPI_TOKEN
61+ poetry publish --build
62+ echo "Published to pypi"
63+ fi
You can’t perform that action at this time.
0 commit comments