提交 6fce270b authored 作者: Dan F-M's avatar Dan F-M 提交者: Brandon T. Willard

Adding support for nightly builds

上级 bca9a381
name: Nightly
on:
schedule:
- cron: "0 0 * * *"
jobs:
build_and_publish:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install build
- name: Build the sdist
run: python -m build --sdist .
env:
BUILD_AESARA_NIGHTLY: true
- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.nightly_pypi_secret }}
#!/usr/bin/env python
import os
import sys
from setuptools import find_packages, setup
......@@ -59,6 +60,24 @@ install_requires = [
if sys.version_info[0:2] < (3, 7):
install_requires += ["dataclasses"]
# Handle builds of nightly release
if "BUILD_AESARA_NIGHTLY" in os.environ:
nightly = True
NAME += "-nightly"
from versioneer import get_versions as original_get_versions
def get_versions():
from datetime import datetime, timezone
suffix = datetime.now(timezone.utc).strftime(r".dev%Y%m%d")
versions = original_get_versions()
versions["version"] = versions["version"].split("+")[0] + suffix
return versions
versioneer.get_versions = get_versions
if __name__ == "__main__":
setup(
name=NAME,
......@@ -66,6 +85,7 @@ if __name__ == "__main__":
cmdclass=versioneer.get_cmdclass(),
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type="text/x-rst",
classifiers=CLASSIFIERS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论