-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (32 loc) · 1.12 KB
/
release_python.yml
File metadata and controls
40 lines (32 loc) · 1.12 KB
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
name: Publish python parser to pypi
on:
workflow_call:
jobs:
build:
name: Build and publish package to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Generate grammar (pre cratedb_sqlparse_py build)
run: |
uv run --with-requirements requirements.txt python setup_grammar.py python
- name: Install cratedb_sqlparse_py dependencies
working-directory: 'cratedb_sqlparse_py'
run: uv sync
- name: Set VERSION from tag
working-directory: 'cratedb_sqlparse_py'
run: |
sed -i -E "s/^version = \".*\"/version = \"${GITHUB_REF#refs/*/v}\"/" pyproject.toml
- name: Build package
working-directory: 'cratedb_sqlparse_py'
run: uv build
- name: Publish to pypi
working-directory: 'cratedb_sqlparse_py'
run: uv publish