Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update publish workflow #2625

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
goodsong81 marked this conversation as resolved.
Show resolved Hide resolved
# NOTE: Sync w/ src/otx/api/usecases/exportable_code/demo/requirements.txt on release
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