-
Notifications
You must be signed in to change notification settings - Fork 87
62 lines (58 loc) · 1.7 KB
/
python-build.yml
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install node dependencies
run: yarn install
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install build
- name: Build frontend
run: yarn build
- name: Build python artifact
run: python -m build
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: release-dist
path: dist
pypi-publish:
runs-on: ubuntu-latest
needs:
- build
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[deploy]')
environment:
name: pypi
url: https://pypi.org/p/data-formulator
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dist
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1