Skip to content

Commit

Permalink
Add a job for publishing Python packages upon release (#7013)
Browse files Browse the repository at this point in the history
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->
Manually with a modified version of the pipeline that uploads to
TestPyPI. See successful run here:
<https://github.com/SpecLad/cvat/actions/runs/6509890509/job/17745596516>.

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- ~~[ ] I have created a changelog fragment~~ <!-- see top comment in
CHANGELOG.md -->
- ~~[ ] I have updated the documentation accordingly~~
- ~~[ ] I have added tests to cover my changes~~
- ~~[ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))~~
- ~~[ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
  • Loading branch information
SpecLad authored Oct 23, 2023
1 parent e038b7c commit 8b0ec00
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
name: Publish Docker images
name: Publish artifacts
on:
release:
types: [released]

jobs:
Push_to_registry:
docker-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build images
run: |
CVAT_VERSION=latest CLAM_AV=yes docker compose -f docker-compose.yml -f docker-compose.dev.yml build
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push to Docker Hub
env:
DOCKERHUB_WORKSPACE: ${{ secrets.DOCKERHUB_WORKSPACE }}
Expand All @@ -29,3 +32,24 @@ jobs:
docker tag "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:latest" "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:${{ github.event.release.tag_name }}"
docker push "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:${{ github.event.release.tag_name }}"
docker push "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:latest"
python-packages:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Generate SDK
run: |
pip3 install --user -r cvat-sdk/gen/requirements.txt
./cvat-sdk/gen/generate.sh
- name: Build packages
run: |
for d in cvat-sdk cvat-cli; do
pipx run --spec=build pyproject-build --outdir=dist "$d"
done
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 8b0ec00

Please sign in to comment.