Skip to content

Commit

Permalink
Added CI to release to Artifactory
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Jan 26, 2023
1 parent 8249994 commit 56cd611
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -465,31 +465,25 @@ jobs:

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [pytest, build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-macos-arm64, build-linux-x86_64, build-linux-arm64]
needs: [deploy-mock, pytest, build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-macos-arm64, build-linux-x86_64, build-linux-arm64]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

# Get tag version
# TODO(themarpe) - Node12, has to be updated
- name: Get tag version
id: tag
uses: battila7/get-version-action@v2

- uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Check if version matches
run: python3.8 -c 'import find_version as v; exit(0) if "${{ steps.tag.outputs.version-without-v }}" == v.get_package_version() else exit(1)'
run: python3.8 -c 'import find_version as v; exit(0) if "${{ github.ref_name }}" == f"v{v.get_package_version()}" else exit(1)'

# Create GitHub release
- uses: actions/create-release@master
id: createRelease
name: Create ${{ steps.tag.outputs.version-without-v }} depthai-core release
name: Create ${{ github.ref_name }} depthai-python release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -504,8 +498,8 @@ jobs:
draft: true

# Deploy to PyPi. Only when a commit is tagged
deploy-pypi:
# Deploy to PyPi and Artifactory. Only when a commit is tagged
deploy:
if: startsWith(github.ref, 'refs/tags/v')
needs: [release]
runs-on: ubuntu-latest
Expand All @@ -525,6 +519,12 @@ jobs:
PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- name: Run deploy to Artifactory
run: bash ./ci/upload-artifactory-release.sh
env:
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}

notify_robothub:
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
9 changes: 9 additions & 0 deletions ci/upload-artifactory-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

curl -fL https://getcli.jfrog.io | sh

cd wheelhouse/audited/ || exit 1
export PATH_PREFIX=luxonis-python-release-local/depthai

../../jfrog config add --artifactory-url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
../../jfrog rt u "*" "$PATH_PREFIX/"

0 comments on commit 56cd611

Please sign in to comment.