-
Notifications
You must be signed in to change notification settings - Fork 16
48 lines (39 loc) · 1.47 KB
/
nightly_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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