Nightly Build #34
This file contains hidden or 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
| 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 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: Install dependencies | |
| run: | | |
| pip install toml poetry | |
| poetry install --no-root | |
| - name: Update version in pyproject.toml | |
| run: | | |
| 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 }} | |