Skip to content

v2.2.4

v2.2.4 #26

Workflow file for this run

name: deploy
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Validate Release Date
run: |
CHANGELOG_DATE=$(head -n 1 CHANGELOG.rst | grep -oP '\d{2}/\d{2}/\d{2}')
TODAY=$(TZ='America/Los_Angeles' date +%m/%d/%y)
if [ "$CHANGELOG_DATE" != "$TODAY" ]; then
echo "CHANGELOG date: $CHANGELOG_DATE"
echo "Today's date: $TODAY"
echo "Please update the CHANGELOG.rst with today's date before releasing."
exit 1
fi
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python --version
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Test
run: |
if [ -d "./tests" ]; then
# only run pytests if a tests/ directory exists
pip install .[test]
pytest --runslow ./tests
else
echo "No tests/ directory found; skipping tests"
fi
- name: Build
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
- name: Send mail
# Notify when cron job fails
if: failure()
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.NOTIFY_EMAIL }}
password: ${{ secrets.NOTIFY_PASSWORD }}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: uw_ihme_simulationscience@uw.edu
# from email name
from: Vivarium Notifications