|
| 1 | +name: Publisher |
| 2 | + |
| 3 | +# Trigger on new github release, a tag with format vX.Y.Z is expected (used to tag the docker) |
| 4 | +on: |
| 5 | + release: |
| 6 | + types: [published] |
| 7 | + |
| 8 | +env: |
| 9 | + OPENDR_VERSION: ${{ github.event.release.tag_name }} |
| 10 | + |
| 11 | +defaults: |
| 12 | + run: |
| 13 | + shell: bash |
| 14 | + |
| 15 | +jobs: |
| 16 | + publish-wheel: |
| 17 | + runs-on: ubuntu-20.04 |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + submodules: true |
| 22 | + - name: Set up Python 3.8 |
| 23 | + uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: 3.8 |
| 26 | + - name: Install prerequisites |
| 27 | + run: | |
| 28 | + python -m pip install --upgrade pip |
| 29 | + pip install setuptools wheel twine |
| 30 | + - name: Build Wheel |
| 31 | + run: | |
| 32 | + ./bin/build_wheel.sh |
| 33 | + - name: Upload Wheel |
| 34 | + env: |
| 35 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 36 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 37 | + run : | |
| 38 | + twine upload dist/* |
| 39 | + publish-docker-cpu: |
| 40 | + runs-on: ubuntu-20.04 |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v2 |
| 43 | + with: |
| 44 | + submodules: true |
| 45 | + - name: Build Docker Image |
| 46 | + run: docker build --tag opendr-toolkit:cpu_$OPENDR_VERSION --file Dockerfile . |
| 47 | + - name: Login to Docker Hub |
| 48 | + uses: docker/login-action@v1 |
| 49 | + with: |
| 50 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 51 | + password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 52 | + - name: Publish Image |
| 53 | + run: | |
| 54 | + docker tag opendr-toolkit:cpu_$OPENDR_VERSION opendr/opendr-toolkit:cpu_$OPENDR_VERSION |
| 55 | + docker push opendr/opendr-toolkit:cpu_$OPENDR_VERSION |
| 56 | + publish-docker-cuda: |
| 57 | + runs-on: ubuntu-20.04 |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v2 |
| 60 | + with: |
| 61 | + submodules: true |
| 62 | + - name: Build Docker Image |
| 63 | + run: docker build --tag opendr-toolkit:cuda_$OPENDR_VERSION --file Dockerfile-cuda . |
| 64 | + - name: Login to Docker Hub |
| 65 | + uses: docker/login-action@v1 |
| 66 | + with: |
| 67 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 68 | + password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 69 | + - name: Publish Image |
| 70 | + run: | |
| 71 | + docker tag opendr-toolkit:cuda_$OPENDR_VERSION opendr/opendr-toolkit:cuda_$OPENDR_VERSION |
| 72 | + docker push opendr/opendr-toolkit:cuda_$OPENDR_VERSION |
0 commit comments