-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update gh actions to allow deploying from fork repo (#913)
* update gh actions to allow deploying from fork repo * format
- Loading branch information
1 parent
f4ed272
commit b4e4a80
Showing
6 changed files
with
93 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: deploy-nightly | ||
|
||
on: | ||
# schedule: | ||
# # * is a special character in YAML so you have to quote this string. | ||
# - cron: "00 6 * * *" | ||
# Allows you to run this workflow manually from the Actions tab. | ||
workflow_dispatch: | ||
inputs: | ||
core-repo: | ||
description: "The repository to use for the core commit." | ||
required: false | ||
type: choice | ||
default: "PreTeXtbook/pretext" | ||
options: | ||
- "PreTeXtbook/pretext" | ||
- "oscarlevin/pretext" | ||
|
||
jobs: | ||
tests: | ||
name: Run tests | ||
uses: ./.github/workflows/tests.yml | ||
|
||
deploy: | ||
needs: tests | ||
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@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
# Setup poetry | ||
- name: Install poetry 1.8.4 | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry==1.8.4 | ||
- name: Install build dependencies | ||
run: sudo apt-get -y install libcairo2-dev pkg-config python3-dev | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: python -m poetry install --all-extras | ||
|
||
- name: Run prep-nightly script and publish if ready | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
echo "Updating core commit and version; building" | ||
output=$(poetry run python scripts/prep_nightly.py ${{ inputs.core-repo }}) | ||
echo "Finished steps to prep nightly deployment" | ||
if [[ $output == *"Ready to deploy"* ]]; then | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --build | ||
echo "Published to pypi" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters