Newer
Older
# @semantic-release/uv
> [**semantic-release**](https://github.com/semantic-release/semantic-release)
> plugin to publish a [`uv`](https://docs.astral.sh/uv) package.
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
| ------------------ | --------------------------------------------------------------------------------------------------------------------- |
| `verifyConditions` | Verify the presence of the `UV_PUBLISH_TOKEN_*` environment variables, and verify the authentication method is valid. |
| `prepare` | Bump the project version and [build][building] it. |
| `publish` | [Publish the package][publishing] to the repositories. |
## Getting Started
```sh
npm config --location project set registry https://gitlab.arm.com/api/v4/groups/semantic-release/-/packages/npm/
npm install --save-dev @semantic-release/uv
```
Add the following to `.releaserc.yaml`:
```yaml
plugins:
- path: "@semantic-release/uv"
repositories:
gitlab: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
```
## Configuration
### `repositories`
The mapping of repository names to PyPI endpoint URLs.
Can use environment variables within the URL via `lodash` templating.
### Authentication
The authentication is found in the environment variables as described by the [`uv` documentation][publishing].
Where `$REPO` is the uppercase version of a repository name, provide either a token:
- `UV_PUBLISH_TOKEN_$REPO`
or, a username and password:
- `UV_PUBLISH_USERNAME_$REPO`
- `UV_PUBLISH_PASSWORD_$REPO`
#### GitLab
Creating a [Deploy Token][deploy-token] with `write_package_registry` permission is the preferred method to restrict the access.
The deploy token can be used with the `uv` username/password authentication to publish packages.
### `uv`
By default this plugin automatically downloads hermetic `uv` binaries from GitHub.
You can use this option to provide a path to a locally installed `uv` CLI instead.
[publishing]: https://docs.astral.sh/uv/guides/publish/#publishing-your-package
[building]: https://docs.astral.sh/uv/guides/publish/#building-your-package
[deploy-token]: https://docs.gitlab.com/ee/user/project/deploy_tokens/