-
Notifications
You must be signed in to change notification settings - Fork 16
65 lines (55 loc) · 1.53 KB
/
publish-to-pypi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Publish BoneIO 🐍 distributions 📦 to PyPI
on:
push:
branches:
- 'main'
- 'dev'
paths:
- '**.py'
- '**.tsx'
- '**.ts'
- 'frontend/**'
pull_request:
branches: [main]
release:
types:
- created
- edited
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-20.04 # Using Ubuntu 20.04 which supports Python 3.7
steps:
- uses: actions/checkout@master
- uses: pdm-project/setup-pdm@v3
name: Setup Python and PDM
with:
python-version: 3.7
architecture: x64
version: 2.6.1
enable-pep582: true
- name: Install dependencies
run: |
python -m pip install -U twine PyYAML==6.0.1
- name: Generate JSON Schemas
run: |
python boneio/helper/schema_converter.py
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Using LTS version of Node.js
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Build Frontend
working-directory: frontend
run: |
npm ci
npm run build
- name: Build
run: |
pdm build
- name: Publish package
if: startsWith(github.ref, 'refs/tags') || startsWith(github.event.inputs.tags, 'Deploy')
run: |
pdm plugin add pdm-publish
pdm publish --password ${{ secrets.PYPI_API_TOKEN }}