[go: nahoru, domu]

Skip to content

Fix publisher.yml workflow #21

Fix publisher.yml workflow

Fix publisher.yml workflow #21

Workflow file for this run

name: Publisher
# Trigger on new github release, a tag with format vX.Y.Z is expected (used to tag the docker)
on:
pull_request:
types: [labeled]
release:
types: [published]
env:
OPENDR_VERSION: v2.2.0
defaults:
run:
shell: bash
jobs:
publish-wheel:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install prerequisites
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build Wheel
run: |
./bin/build_wheel.sh
- name: Upload Wheel
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run : |
twine upload dist/*
publish-docker-cpu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: Build Docker Image
run: docker build --tag opendr-toolkit:cpu_$OPENDR_VERSION --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Publish Image
run: |
docker tag opendr-toolkit:cpu_$OPENDR_VERSION opendr/opendr-toolkit:cpu_$OPENDR_VERSION
docker push opendr/opendr-toolkit:cpu_$OPENDR_VERSION
publish-docker-cuda:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: Build Docker Image
run: docker build --tag opendr-toolkit:cuda_$OPENDR_VERSION --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --file Dockerfile-cuda .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Publish Image
run: |
docker tag opendr-toolkit:cuda_$OPENDR_VERSION opendr/opendr-toolkit:cuda_$OPENDR_VERSION
docker push opendr/opendr-toolkit:cuda_$OPENDR_VERSION