mirror of
https://github.com/microsoft/data-formulator.git
synced 2026-11-06 22:15:35 +00:00
65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
# 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" ]
|
|
|
|
# Global permissions required for OIDC authentication
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Set Node.js 20
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: 20
|
|
cache: 'yarn'
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
python-version: 3.12
|
|
- name: Install node dependencies
|
|
run: yarn install --frozen-lockfile
|
|
- name: Build frontend
|
|
run: yarn build
|
|
- name: Build python artifact
|
|
run: uv build
|
|
- name: Validate python artifact
|
|
run: uv run --with twine twine check dist/*
|
|
- name: Archive production artifacts
|
|
uses: actions/upload-artifact@v7
|
|
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@v8
|
|
with:
|
|
name: release-dist
|
|
path: dist/
|
|
- name: Publish package distributions to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|