forked from opensandbox-group/OpenSandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.35 KB
/
publish-cli.yml
File metadata and controls
68 lines (56 loc) · 1.35 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
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
66
67
68
name: Publish CLI
on:
push:
tags:
- 'cli/v*'
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
jobs:
publish-pypi:
if: startsWith(github.ref, 'refs/tags/cli/v')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Install dependencies
working-directory: cli
run: |
uv sync --frozen
- name: Run lint
working-directory: cli
run: |
uv run ruff check
- name: Run type checks
working-directory: cli
run: |
uv run pyright
- name: Run tests
working-directory: cli
run: |
uv run pytest
- name: Build package
working-directory: cli
run: |
uv build
- name: Attest built package
if: startsWith(github.ref, 'refs/tags/cli/v')
uses: actions/attest@v4
with:
subject-path: cli/dist/*
- name: Publish to PyPI
working-directory: cli
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv publish