ci: push package to test.pypi.org (#8495)

* ci: push package to test.pypi.org

* include dvc.testing and license file
This commit is contained in:
skshetry
2022-10-31 23:34:00 +05:45
committed by GitHub
parent c8e39523c3
commit 120a5879bb
3 changed files with 21 additions and 12 deletions
+16 -8
View File
@@ -82,21 +82,29 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: pyproject.toml
- name: Install
run: |
pip install -U wheel pip build setuptools
pip install ".[all,tests]"
run: pip install -U wheel pip build setuptools_scm
- name: Force version for Test PyPI uploads
if: ${{ !startsWith(github.ref, 'refs/tags') }}
run: echo version=$(python -m setuptools_scm | awk -F+ '{print $1}' | tail -1) >> $GITHUB_ENV
- name: Build packages
run: |
pip install -U pip
./scripts/build_package.sh
run: ./scripts/build_package.sh
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.version }}
- name: Publish packages to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
- name: Publish to Test PyPI
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
+3 -2
View File
@@ -16,7 +16,7 @@ keywords = [
"collaboration",
"ai",
]
license = { file = "LICENSE" }
license = { text = "Apache License 2.0" }
authors = [{ name = "Dmitry Petrov", email = "[email protected]" }]
maintainers = [{ name = "Iterative", email = "[email protected]" }]
requires-python = ">=3.8"
@@ -131,9 +131,10 @@ dvc = "dvc.api:DVCFileSystem"
[tool.setuptools]
zip-safe = false
license-files = ["LICENSE"]
[tool.setuptools.packages.find]
exclude = ["dvc.testing", "dvc.testing.*", "tests", "tests.*"]
exclude = ["tests", "tests.*"]
[tool.setuptools_scm]
write_to = "dvc/_dvc_version.py"
+2 -2
View File
@@ -10,5 +10,5 @@ fi
echo 'PKG = "pip"' >dvc/utils/build.py
python -m pip install -U build setuptools>=58.2
python -m build --sdist --wheel --outdir dist/
python -m pip install -U build setuptools>=61
python -m build