Skip to content

Commit 80552b9

Browse files
committed
add workflow for poetry package
1 parent 23b47aa commit 80552b9

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,34 @@ jobs:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3232

33-
33+
release_pypi:
34+
runs-on: ubuntu-latest
35+
needs: release_node
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.12"
42+
- name: Generate UI Assets
43+
run: |
44+
cd sphinx-ui/react/
45+
echo "🔨 Generating UI assets..."
46+
npm update @quantinuum/documentation-ui
47+
npm install
48+
npm run build
49+
cp ./build/injectNav.global.js ../quantinuum_sphinx/static/injectNav.global.js
50+
cp ./build/syncTheme.global.js ../quantinuum_sphinx/static/syncTheme.global.js
51+
cp ./node_modules/@quantinuum/quantinuum-ui/dist/tokens.css ../quantinuum_sphinx/static/styles/quantinuum-ui-tokens.css
52+
npx tailwindcss --postcss ./postcss.config.cjs -i ./index.css -o ../quantinuum_sphinx/static/styles/quantinuum-ui-tailwind.css
53+
echo ✅ "Done. Generated UI assets."
54+
- name: Build and Publish to PyPI
55+
env:
56+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
57+
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
58+
run: |
59+
echo "📦 Building and publishing to PyPI..."
60+
poetry config http-basic.pypi_local ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_API_TOKEN }}
61+
poetry build
62+
poetry publish
63+
echo ✅ "Done. Published Package to PyPI."

0 commit comments

Comments
 (0)