Skip to content
name: build_and_upload_release
on:
release:
types:
- published
jobs:
build:
name: build and upload release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5
- name: setup poetry
run: |
python -m pip install --upgrade pip poetry
- name: setup Bun
run: npm install -g bun
- name: build frontend
run: |
bun install
bun run build
cp -r ./dist/* ../backend/chatsky_ui/static
working-directory: frontend
- name: build wheels and test uploading to pypi
if: startsWith(github.ref, 'refs/tags/v') != true
run: |
python -m poetry --build publish --dry-run
working-directory: backend
- name: build wheels and upload to pypi
if: startsWith(github.ref, 'refs/tags/v')
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
python -m poetry --build publish
working-directory: backend
- name: upload binaries into release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: backend/dist/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true