-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (46 loc) · 1.47 KB
/
publish.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
name: Publish
on:
push:
branches: [main]
paths:
# if the version.py changes, we should re-publish
# this also allows us to run the workflow manually without skipping.
- "cartesia/version.py"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cartesia
# TODO: Make permissions more restrictive
permissions: write-all
env:
commitmsg: ${{ github.event.head_commit.message }}
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install the project
run: uv sync --all-extras --dev
- name: Build the project
run: uv build
- name: Publish to PyPI
run: uv publish
- name: Get version
run: |
export CARTESIA_PYTHON_VERSION=$(grep -o '".*"' cartesia/version.py | sed 's/"//g')
echo "CARTESIA_PYTHON_VERSION=${CARTESIA_PYTHON_VERSION}" >> $GITHUB_ENV
- name: Verify version
run: echo ${{ env.CARTESIA_PYTHON_VERSION }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.CARTESIA_PYTHON_VERSION }}