Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Bump follow-redirects from 1.15.3 to 1.15.4 in /docs (#99) #57

Bump follow-redirects from 1.15.3 to 1.15.4 in /docs (#99)

Bump follow-redirects from 1.15.3 to 1.15.4 in /docs (#99) #57

Workflow file for this run

name: Publish to PyPI and NPM if version changes
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Check version for openassistants
id: check_version_openassistants
run: |
echo "CHECK_VERSION_OPENASSISTANTS=" >> $GITHUB_ENV
cd packages/openassistants
CURRENT_VERSION=$(poetry version -s)
PYPI_VERSION=$(curl -s https://pypi.org/pypi/definitive-openassistants/json | jq -r .info.version)
if [ "$CURRENT_VERSION" != "$PYPI_VERSION" ]; then
echo "CHECK_VERSION_OPENASSISTANTS=true" >> $GITHUB_ENV
else
echo "CHECK_VERSION_OPENASSISTANTS=false" >> $GITHUB_ENV
fi
- name: Check version for openassistants-fastapi
id: check_version_openassistants_fastapi
run: |
echo "CHECK_VERSION_OPENASSISTANTS_FASTAPI=" >> $GITHUB_ENV
cd packages/openassistants-fastapi
CURRENT_VERSION=$(poetry version -s)
PYPI_VERSION=$(curl -s https://pypi.org/pypi/definitive-openassistants-fastapi/json | jq -r .info.version)
if [ "$CURRENT_VERSION" != "$PYPI_VERSION" ]; then
echo "CHECK_VERSION_OPENASSISTANTS_FASTAPI=true" >> $GITHUB_ENV
else
echo "CHECK_VERSION_OPENASSISTANTS_FASTAPI=false" >> $GITHUB_ENV
fi
- name: Check version for openassistants-react
id: check_version_openassistants_react
run: |
echo "CHECK_VERSION_OPENASSISTANTS_REACT=" >> $GITHUB_ENV
cd packages/openassistants-react
CURRENT_VERSION=$(node -p "require('./package.json').version")
NPM_VERSION=$(curl -s https://registry.npmjs.org/@definitive-io/openassistants-react | jq -r '.["dist-tags"].latest')
if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
yarn install
echo "CHECK_VERSION_OPENASSISTANTS_REACT=true" >> $GITHUB_ENV
else
echo "CHECK_VERSION_OPENASSISTANTS_REACT=false" >> $GITHUB_ENV
fi
- name: Publish openassistants to PyPI
if: env.CHECK_VERSION_OPENASSISTANTS == 'true'
run: make publish-openassistants
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
- name: Publish openassistants-fastapi to PyPI
if: env.CHECK_VERSION_OPENASSISTANTS_FASTAPI == 'true'
run: make publish-openassistants-fastapi
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
- name: Publish openassistants-react to NPM
if: env.CHECK_VERSION_OPENASSISTANTS_REACT == 'true'
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
make publish-openassistants-react
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}