Skip to content

Commit 24e67a6

Browse files
authored
add back nightly build action (#997)
1 parent 4279457 commit 24e67a6

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

0 commit comments

Comments
 (0)