mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-21 06:45:24 -06:00
chore(workflows): update build workflows
This commit is contained in:
parent
2c309cc5ec
commit
5f8013c059
1 changed files with 22 additions and 9 deletions
31
.github/workflows/build.yaml
vendored
31
.github/workflows/build.yaml
vendored
|
|
@ -93,12 +93,17 @@ jobs:
|
|||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
run: |
|
||||
sed -i -E 's/^__release__\s*=.*$/__release__ = True/' nvitop/version.py
|
||||
sed -i -E 's/^__release__\s*=.*$/__release__ = True/' nvitop-exporter/nvitop_exporter/version.py
|
||||
|
||||
- name: Print version
|
||||
run: python setup.py --version
|
||||
run: |
|
||||
python setup.py --version
|
||||
python nvitop-exporter/setup.py --version
|
||||
|
||||
- name: Build sdist and wheels
|
||||
run: python -m build
|
||||
run: |
|
||||
python -m build --outdir dist .
|
||||
python -m build --outdir dist nvitop-exporter
|
||||
|
||||
- name: List built sdist and wheels
|
||||
run: ls -lh dist/
|
||||
|
|
@ -136,15 +141,23 @@ jobs:
|
|||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
run: |
|
||||
sed -i -E 's/^__release__\s*=.*$/__release__ = True/' nvitop/version.py
|
||||
sed -i -E 's/^__release__\s*=.*$/__release__ = True/' nvitop-exporter/nvitop_exporter/version.py
|
||||
|
||||
- name: Print version
|
||||
run: python setup.py --version
|
||||
run: |
|
||||
python setup.py --version
|
||||
python nvitop-exporter/setup.py --version
|
||||
|
||||
- name: Check consistency between the package version and release tag
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
PACKAGE_VER="v$(python setup.py --version)"
|
||||
RELEASE_TAG="${GITHUB_REF#refs/*/}"
|
||||
PACKAGE_VER="v$(python setup.py --version)"
|
||||
if [[ "${PACKAGE_VER}" != "${RELEASE_TAG}" ]]; then
|
||||
echo "package ver. (${PACKAGE_VER}) != release tag. (${RELEASE_TAG})"
|
||||
exit 1
|
||||
fi
|
||||
PACKAGE_VER="v$(python nvitop-exporter/setup.py --version)"
|
||||
if [[ "${PACKAGE_VER}" != "${RELEASE_TAG}" ]]; then
|
||||
echo "package ver. (${PACKAGE_VER}) != release tag. (${RELEASE_TAG})"
|
||||
exit 1
|
||||
|
|
@ -164,10 +177,10 @@ jobs:
|
|||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.TESTPYPI_UPLOAD_TOKEN }}
|
||||
repository_url: https://test.pypi.org/legacy/
|
||||
repository-url: https://test.pypi.org/legacy/
|
||||
verbose: true
|
||||
print_hash: true
|
||||
skip_existing: true
|
||||
print-hash: true
|
||||
skip-existing: true
|
||||
|
||||
- name: Publish to PyPI
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
|
|
@ -176,5 +189,5 @@ jobs:
|
|||
user: __token__
|
||||
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
|
||||
verbose: true
|
||||
print_hash: true
|
||||
skip_existing: true
|
||||
print-hash: true
|
||||
skip-existing: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue