Correct model name in OpenAI integration docs (#610) #162
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check and Update Versions | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pip install poetry jq | |
- name: Execute version check script | |
run: | | |
#!/bin/bash | |
get_latest_version() { | |
package_name=$1 | |
latest_version=$(curl -s "https://pypi.org/pypi/$package_name/json" | jq -r '.info.version') | |
echo "$latest_version" | |
} | |
files=$(find . -type f -name "pyproject.toml") | |
for file in $files; do | |
current_version=$(grep '^version =' "$file" | awk -F'"' '{print $2}') | |
package_name=$(grep '^name =' "$file" | awk -F'"' '{print $2}') | |
latest_version=$(get_latest_version "$package_name") | |
echo "File: $file" | |
echo "Current Version: $current_version" | |
echo "Latest Version on PyPI: $latest_version" | |
if [ "$current_version" != "$latest_version" ]; then | |
echo "Version is outdated. Updating..." | |
# Go to the directory of the relevant pyproject.toml file | |
dir=$(dirname "$file") | |
cd "$dir" | |
poetry lock | |
pip install -e . | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
poetry publish --build | |
# Sleep to allow some time for pypi package to upload | |
echo "Waiting for version to update..." | |
sleep 60 | |
echo "Package updated" | |
# Return to the root of the repository | |
cd - > /dev/null | |
else | |
echo "Version is up-to-date." | |
fi | |
echo "-------------------------------------" | |
done |