-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
68 lines (60 loc) · 1.82 KB
/
Copy pathaction.yml
File metadata and controls
68 lines (60 loc) · 1.82 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: "template-python-rust-cmd"
description: >-
Composite action that installs the `template-cli` binary shipped with
the template-python-rust-cmd Python package, then exposes it on PATH
for downstream steps. Pair with `./cleanup` for a clean
post-job state.
branding:
icon: "package"
color: "purple"
inputs:
version:
description: >-
Version of the template-python-rust-cmd Python package to install.
Defaults to the version declared in pyproject.toml of the consuming
repo (resolved by uv).
required: false
default: ""
python-version:
description: >-
Python version uv should provision the install venv with.
Defaults to a recent CPython compatible with the package's
requires-python lower bound.
required: false
default: "3.11"
outputs:
binary-path:
description: >-
Absolute path to the installed `template-cli` binary.
value: ${{ steps.expose.outputs.binary-path }}
runs:
using: "composite"
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Provision Python
shell: bash
run: |
uv python install ${{ inputs.python-version }}
- name: Install template-python-rust-cmd via uv tool
shell: bash
run: |
if [ -n "${{ inputs.version }}" ]; then
uv tool install "template-python-rust-cmd==${{ inputs.version }}"
else
uv tool install template-python-rust-cmd
fi
- name: Expose binary path
id: expose
shell: bash
run: |
bin_path="$(command -v template-cli)"
echo "binary-path=$bin_path" >> "$GITHUB_OUTPUT"
echo "$(dirname "$bin_path")" >> "$GITHUB_PATH"
- name: Smoke-test the surface
shell: bash
run: |
template-cli --version
template-cli --help