Skip to content

Commit

Permalink
Update publish workflow (#2625)
Browse files Browse the repository at this point in the history
update publish workflow to push whl to internal pypi
  • Loading branch information
yunchu authored Nov 10, 2023
1 parent 2c9b745 commit 13a3993
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and upload to PyPI
name: Build and upload to internal PyPI

on:
workflow_dispatch: # run on request (no need for PR)
Expand Down Expand Up @@ -40,17 +40,22 @@ jobs:
name: Publish package
needs: [build_wheels, build_sdist]
environment: pypi
runs-on: ubuntu-latest
runs-on: [self-hosted, linux, x64, dev]
permissions: write-all
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: python -m pip install twine
- name: Download artifacts
uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
# to determine where to publish the source distribution to PyPI or TestPyPI
- name: Check tag
id: check-tag
uses: actions-ecosystem/action-regex-match@v2
Expand All @@ -66,15 +71,18 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Publish package distributions to PyPI
if: ${{ steps.check-tag.outputs.match != '' }}
uses: pypa/gh-action-pypi-publish@v1.7.1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish package distributions to TestPyPI
if: ${{ steps.check-tag.outputs.match == '' }}
uses: pypa/gh-action-pypi-publish@v1.7.1
with:
password: ${{ secrets.TESTPYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
verbose: true
- name: Check dist contents
run: twine check dist/*
- name: Publish package dist to internal PyPI
run: |
export no_proxy=${{ secrets.PYPI_HOST }}
export REPOSITORY_URL=http://${{ secrets.PYPI_HOST }}:${{ secrets.PYPI_PORT }}
twine upload --verbose --repository-url $REPOSITORY_URL dist/* -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
- name: Clean up dist
if: ${{ always() }}
run: |
if OUTPUT=$(ls | grep -c dist)
then
echo "Cleaning up dist directory"
rm -r dist
fi
2 changes: 1 addition & 1 deletion src/otx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Copyright (C) 2021-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

__version__ = "1.4.4rc1"
__version__ = "1.4.4"
# NOTE: Sync w/ src/otx/api/usecases/exportable_code/demo/requirements.txt on release
2 changes: 1 addition & 1 deletion src/otx/api/usecases/exportable_code/demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openvino==2023.0
openvino-model-api==0.1.6
otx==1.4.4rc1
otx==1.4.4
numpy>=1.21.0,<=1.23.5 # np.bool was removed in 1.24.0 which was used in openvino runtime

0 comments on commit 13a3993

Please sign in to comment.