Skip to content

Nightly Build

Nightly Build #186

Workflow file for this run

name: Nightly Build
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *' # Runs daily at 22:00 EST
jobs:
main:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history and tags
- name: Scan for Changes
id: check-diff
run: |
CHANGED_FILES=$(git diff $(git describe --tags --abbrev=0) HEAD --name-only)
if [ -z "$CHANGED_FILES" ]; then exit; fi
- name: Checkout code
uses: actions/checkout@v4
- name: Get Current Date
id: date
run: |
export TZ='America/New_York' # Set timezone to EST
echo "ISO=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.*'
- name: Initialize Poetry
run: |
pip install poetry
poetry lock
poetry install --no-root --no-interaction
- name: Update version in pyproject.toml
run: |
pip install toml
python -c "
from toml import load, dump
with open('pyproject.toml', 'r') as f:
data = load(f)
data['project']['version'] = 'v${{ env.ISO }}'
with open('pyproject.toml', 'w') as f:
dump(data, f)
"
- name: Save Changes
uses: stefanzweifel/git-auto-commit-action@v5
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.ISO }}
name: ${{ env.ISO }}
body: Automatic Nightly Build
prerelease: false
draft: false
- name: Build package
run: poetry build
- name: Publish package to PyPI
run: poetry publish --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}