Skip to content

Build python package manually (with built frontend) #6

Build python package manually (with built frontend)

Build python package manually (with built frontend) #6

Workflow file for this run

name: Build python package with built frontend
on:
# push
workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
id: node-setup
uses: actions/setup-node@v4
with:
node-version: "20.x"
- uses: actions/cache@v4
id: frontend-cache-id
with:
path: frontend/node_modules
key: npm-${{ hashFiles('frontend/**/package-lock.json') }}
restore-keys: npm-
- name: Install npm deps
if: steps.frontend-cache-id.outputs.cache-hit != 'true'
working-directory: frontend
run: npm ci
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "poetry"
cache-dependency-path: backend/poetry.lock
- name: Copy built FE to BE
run: cp -r frontend/dist backend/qualibrate_static
- name: Install python deps
run: poetry install
working-directory: backend
- name: Build python package
run: poetry build
working-directory: backend
- uses: actions/upload-artifact@v4
name: Upload sdist
with:
name: sdist
path: backend/dist/qualibrate_app-0.1.0.tar.gz
retention-days: 3
if-no-files-found: error
- uses: actions/upload-artifact@v4
name: Upload wheel
with:
name: wheel
path: backend/dist/qualibrate_app-0.1.0-py3-none-any.whl
retention-days: 3
if-no-files-found: error