-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
91 lines (88 loc) · 3.65 KB
/
action.yml
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
82
83
84
85
86
87
88
89
90
91
name: "Release uv Python Project"
description: "Release a uv Python project using semantic-release"
branding:
icon: upload-cloud
color: blue
inputs:
python-version:
description: "Python version. If not set, Python will not be setup automatically."
required: false
uv-version:
description: "Poetry version. If not set, poetry will not be setup automatically."
required: false
pypi-token:
description: "PyPI token. If not set, trusted publishing may be used."
required: false
github-token:
description: "GitHub token"
required: false
default: ${{ github.token }}
uv-publish:
description: "Whether to run uv publish after releasing"
required: false
default: "true"
outputs:
released:
description: Whether a new release was published. The return value is in the form of a string. ("true" or "false")
value: ${{ steps.semantic-release.outputs.new_release_published }}
version:
description: Version of the new release. (e.g. "1.3.0")
value: ${{ steps.semantic-release.outputs.new_release_version }}
major:
description: Major version of the new release. (e.g. "1")
value: ${{ steps.semantic-release.outputs.new_release_major_version }}
minor:
description: Minor version of the new release. (e.g. "3")
value: ${{ steps.semantic-release.outputs.new_release_minor_version }}
patch:
description: Patch version of the new release. (e.g. "0")
value: ${{ steps.semantic-release.outputs.new_release_patch_version }}
channel:
description: The distribution channel on which the last release was initially made available (undefined for the default distribution channel).
value: ${{ steps.semantic-release.outputs.new_release_channel }}
release-notes:
description: The release notes for the new release.
value: ${{ steps.semantic-release.outputs.new_release_notes }}
git-head:
description: The sha of the last commit being part of the new release
value: ${{ steps.semantic-release.outputs.new_release_git_head }}
git-tag:
description: The Git tag associated with the new release.
value: ${{ steps.semantic-release.outputs.new_release_git_tag }}
prev-version:
description: Version of the previous release, if there was one. (e.g. "1.2.0")
value: ${{ steps.semantic-release.outputs.last_release_version }}
prev-git-head:
description: The sha of the last commit being part of the last release, if there was one.
value: ${{ steps.semantic-release.outputs.last_release_git_head }}
prev-git-tag:
description: The Git tag associated with the last release, if there was one.
value: ${{ steps.semantic-release.outputs.last_release_git_tag }}
runs:
using: "composite"
steps:
- name: Setup Python
if: ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: "${{ inputs.python-version }}"
- name: Setup uv
if: ${{ inputs.uv-version }}
uses: astral-sh/setup-uv@v5
with:
version: "${{ inputs.uv-version }}"
- name: Get semantic-release version
shell: sh
id: semantic-release-version
run: "echo version=$(npm view @cihelper/semanticrelease-preset-uv dependencies.semantic-release) >> $GITHUB_OUTPUT"
- name: Run semantic-release
id: semantic-release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
PYPI_TOKEN: ${{ inputs.pypi-token }}
SEMREL_UV_PUBLISH: ${{ inputs.uv-publish }}
with:
semantic_version: ${{ steps.semantic-release-version.outputs.version }}
extra_plugins: "@cihelper/semanticrelease-preset-uv@1"
extends: "@cihelper/semanticrelease-preset-uv"