70 lines
2.6 KiB
Markdown
70 lines
2.6 KiB
Markdown
# Development and packaging
|
|
|
|
## Bridge checks
|
|
|
|
Run the same checks as Jenkins before submitting a bridge change:
|
|
|
|
```sh
|
|
cargo fmt --all -- --check
|
|
cargo check --all-targets --all-features
|
|
cargo test --all-targets --all-features
|
|
cargo clippy --all-targets --all-features -- -D warnings
|
|
```
|
|
|
|
## Companion VSG fork
|
|
|
|
The fork keeps its stream-support patch small and rebases it onto upstream
|
|
`master`. From the fork checkout:
|
|
|
|
```sh
|
|
./update-fork.sh
|
|
./build-package.sh
|
|
```
|
|
|
|
To build and publish with an explicit Gitea token file:
|
|
|
|
```sh
|
|
chmod 600 ../gitea_token.txt
|
|
./build-package.sh ../gitea_token.txt --publish
|
|
```
|
|
|
|
The script builds both a wheel and source distribution and uploads only the
|
|
artifacts produced by that invocation. It also accepts `GITEA_TOKEN` or
|
|
`GITEA_TOKEN_FILE` when no positional token file is supplied.
|
|
|
|
## Jenkins package publishing
|
|
|
|
The VSG Jenkins pipeline publishes successful `master` builds automatically.
|
|
It fetches repository tags before setup so `setuptools-git-versioning` can
|
|
derive the package version, then publishes the same wheel and source archive
|
|
that passed the pip and uv installation checks. Other branches never receive
|
|
the publishing credential.
|
|
|
|
Create the credential in Jenkins:
|
|
|
|
1. Create a Gitea personal access token whose `package` permission is set to
|
|
**Read and Write**. Use an account allowed to publish packages owned by the
|
|
`MadGobblins` organization.
|
|
2. Open **Manage Jenkins → Credentials**, select the narrowest folder or system
|
|
store containing the multibranch job, and choose **Add Credentials**.
|
|
3. Select **Secret text**, paste the token into **Secret**, and set **ID** to
|
|
`vsg-gitea-package-token`.
|
|
4. Save it. The Credentials Binding plugin must be installed for the
|
|
`withCredentials` pipeline step.
|
|
|
|
The token exists only as `GITEA_TOKEN` inside the publish stage. Shell tracing
|
|
is disabled before it is mapped to uv's `UV_PUBLISH_PASSWORD`; it is never put
|
|
in a command argument or written into the workspace.
|
|
|
|
Published versions come from the existing Git-versioning backend. An exact
|
|
release version requires a version tag on the commit; untagged commits receive
|
|
the backend's post-release version. Because package versions are immutable in
|
|
Gitea, the pipeline uses uv's index check to skip files already present.
|
|
|
|
## References
|
|
|
|
- [Language Server Protocol 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)
|
|
- [tower-lsp stdio example](https://github.com/ebkalderon/tower-lsp/blob/master/examples/stdio.rs)
|
|
- [upstream VSG](https://github.com/jeremiah-c-leary/vhdl-style-guide)
|
|
- [upstream VSG documentation](https://vhdl-style-guide.readthedocs.io/en/latest/)
|