Skip to content

Sidecar build for windows #50

Sidecar build for windows

Sidecar build for windows #50

name: Sidecar build for windows
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-2019 # Run this job on a windows environment
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Install 7-Zip
run: choco install 7zip.install
- name: Demo run for 7zip
run: |
./package_windows.sh
- name: Run 7z action
run: |
7z a -t7z "sidecar_test.7z" "sidecar/onnxruntime/" "sidecar/qdrant/" "sidecar/models/"
- name: Run 7z action again
run: |
7z a -t7z "sidecar_test.7z" "sidecar/onnxruntime/" "sidecar/qdrant/" "sidecar/models/"
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Build
run: |
cargo build --release
# Now run the .sh script which does the building and packaging
- name: Build and package
run: |
./package_windows_bin.sh
# This updates the environment variable
- name: Set CLOUDSDK_PYTHON environment variable
run: echo "CLOUDSDK_PYTHON=$(which python)" >> $GITHUB_ENV
# Install gcp skcd
- name: Setup GCP SDK
uses: 'google-github-actions/setup-gcloud@v1'
with:
project_id: '${{ env.GCP_PROJECT_ID }}'
service_account_key: '${{ secrets.GCP_SA_KEY }}'
# Setup auth for gcp
- name: GPC Auth
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_GAE_SA_KEY }}'
- name: Upload to GCP bucket generated zip file
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_BUCKET_NAME: ${{ secrets.GCP_BUCKET_NAME }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
run: |
# Decode the GCP_SA_KEY secret and write the contents to a temporary file
echo "$GCP_SA_KEY" | base64 --decode > gcp_sa_key.json
# Authenticate to gcloud with the service account key
gcloud auth activate-service-account --key-file=gcp_sa_key.json
# Set your GCP project
gcloud config set project ${{ env.GCP_PROJECT_ID }}
# Copy the built binary to the GCP bucket
gsutil cp sidecar.zip "gs://sidecar-bin/windows/sidecar.zip"