Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (76 loc) · 2.65 KB
/
Copy pathaction.yml
File metadata and controls
81 lines (76 loc) · 2.65 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
69
70
71
72
73
74
75
76
77
78
79
80
81
name: "Python publish"
description:
"Build a Python project with uv and publish it to a devpi index;
already-published versions are a no-op."
author: "DataLabHell"
branding:
icon: "upload-cloud"
color: "blue"
# Installs uv (via setup-uv), then builds and publishes. Publishing is gated on
# the branch: by default only "main" publishes, so the same workflow can run on
# feature branches without pushing anything. The caller owns the job (runner,
# checkout) and resolves the version with one of the versioning/ actions (see
# the README) — this action only pretends it to setuptools-scm when the project
# uses dynamic versioning.
inputs:
version:
description:
"Version to publish, bare X.Y.Z (from versioning/auto-patch or
versioning/from-pyproject). Required for projects with dynamic versioning;
ignored for projects with a fixed [project].version."
required: false
default: ""
release-branch:
description:
"The only branch that publishes a final version; every other ref publishes
a prerelease (or nothing)."
required: false
default: "main"
publish-other-branches:
description:
'Also publish from refs other than release-branch, as
"X.Y.Z.dev<pr-number>+<short-sha>"'
required: false
default: "false"
build:
description: 'Run "uv build" before publishing'
required: false
default: "true"
build-args:
description: 'Extra args passed to "uv build"'
required: false
default: ""
url:
description: "Base URL of the devpi index to publish to."
required: true
username:
description: "devpi user to publish as."
required: true
password:
description: "Password of the devpi user."
required: true
outputs:
published:
description: '"true" if the publish step ran, "false" if it was skipped'
value: ${{ steps.publish.outputs.published || 'false' }}
version:
description: "The version that was published (empty when skipped)"
value: ${{ steps.publish.outputs.version }}
runs:
using: "composite"
steps:
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: Publish
id: publish
shell: bash
run: bash "${{ github.action_path }}/publish.sh"
env:
INPUT_VERSION: ${{ inputs.version }}
INPUT_RELEASE_BRANCH: ${{ inputs.release-branch }}
INPUT_PUBLISH_OTHER_BRANCHES: ${{ inputs.publish-other-branches }}
INPUT_BUILD: ${{ inputs.build }}
INPUT_BUILD_ARGS: ${{ inputs.build-args }}
UV_PUBLISH_USERNAME: ${{ inputs.username }}
UV_PUBLISH_PASSWORD: ${{ inputs.password }}
DEVPI_URL: ${{ inputs.url }}