Skip to content

Nightly PyPI Release #1

Nightly PyPI Release

Nightly PyPI Release #1

# This workflows will upload a Python Package using Twine as nightly release
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Nightly PyPI Release
on:
schedule:
- cron: '59 8 * * *' # Runs at 08:59 UTC every day
workflow_dispatch: # Manual trigger for testing
jobs:
nightly_release:
runs-on: ubuntu-latest
environment: pypi
if: github.repository == 'autogluon/autogluon-assistant'
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CICD_PAT }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Update version for nightly
run: |
current_version=$(grep -A10 '^\[project\]' pyproject.toml | grep '^version = ' | cut -d'"' -f2)
nightly_version="${current_version}.dev$(TZ=America/Los_Angeles date +'%Y%m%d')"
perl -pi -e "s/version = \"${current_version}\"/version = \"${nightly_version}\"/" pyproject.toml
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
skip-existing: true