Workflow file for this run
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: Publish ContextQA 🐍 distribution 📦 to PyPI | |
# on: | |
# release: | |
# types: [published] | |
on: | |
push: | |
branches: | |
- feature/installable-package | |
jobs: | |
build-n-publish: | |
name: Build and publish | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@master | |
# Set up Node.js environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
# Install npm dependencies for client | |
- name: Install client dependencies | |
run: npm install | |
working-directory: client | |
# Build client application | |
- name: Build client UI 📦 | |
run: npm run build | |
working-directory: client | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install pypa/setuptools | |
run: >- | |
python -m | |
pip install wheel pipenv twine | |
- name: Generate requirements | |
run: | | |
pipenv requirements > requirements.txt | |
sed -i '1d' requirements.txt | |
working-directory: api | |
- name: Extract tag name | |
id: tag | |
run: echo ::set-output name=TAG_NAME::$(echo 1.7.0) | |
- name: Update version in setup.py | |
run: | | |
echo "THIS IS THE VERSION: ${{ steps.tag.outputs.TAG_NAME }}" | |
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py | |
working-directory: api | |
- name: Build a binary wheel | |
run: >- | |
python setup.py sdist bdist_wheel | |
working-directory: api | |
- name: Publish ContextQA 📦 to PyPI | |
run: | | |
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} | |
working-directory: api | |