-
Notifications
You must be signed in to change notification settings - Fork 72
51 lines (45 loc) · 1.4 KB
/
pypi-release.yml
File metadata and controls
51 lines (45 loc) · 1.4 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
---
# Publishes the OpenHands PyPi package
name: Publish PyPi Package
on:
workflow_dispatch:
inputs:
reason:
description: What are you publishing?
required: true
type: choice
options:
- cli
default: cli
push:
tags:
- '*'
jobs:
release-cli:
name: Publish CLI to PyPI
runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
id-token: write
# Run when manually dispatched for "cli" OR for any tag pushes
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.reason == 'cli')
|| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: latest
- name: Build CLI package
run: |
# Clean dist directory to avoid conflicts with binary builds
rm -rf dist/
uv build
- name: Publish CLI to PyPI
run: |
uv publish