diff --git a/.github/workflows/cargo-publish.yml b/.github/workflows/cargo-publish.yml new file mode 100644 index 00000000..47adacd7 --- /dev/null +++ b/.github/workflows/cargo-publish.yml @@ -0,0 +1,29 @@ +name: Cargo Publish + +on: + release: + types: [ published ] + +env: + # This env var is used by Swatinem/rust-cache@v2 for the cache + # key, so we set it to make sure it is always consistent. + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-22.04 + timeout-minutes: 30 + # Only runs on tags that matches the make-release action + if: startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y protobuf-compiler libssl-dev + - name: Publish the package + run: | + cargo publish -p vectordb --all-features --token ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 9b43d88c..6749e63c 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -3,12 +3,12 @@ name: PyPI Publish on: release: types: [ published ] - tags: - - 'python-v*' # Push events that matches the python-make-release action jobs: publish: runs-on: ubuntu-latest + # Only runs on tags that matches the python-make-release action + if: startsWith(github.ref, 'refs/tags/python-v') defaults: run: shell: bash