mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 03:53:56 -07:00
[Protocol] Inline package assembly, fix cmake-format, add workflow_dispatch
- Replace the custom Node packaging script with a flat inline step (cp the .proto glob, cp the static files, npm version) so the workflow speaks the same shell idiom as the other workflows. - Promote package.json and README.md to static files under libcockatrice_protocol/npm/ so contributors edit them in-place. - Re-format libcockatrice_protocol/CMakeLists.txt per .cmake-format.json. - Add workflow_dispatch (manual run; optional version input) and timeout-minutes: 10. - Drop --provenance from npm publish: GitHub Packages doesn't attest Sigstore provenance.
This commit is contained in:
parent
cc4a53b850
commit
b870ce0a4a
5 changed files with 111 additions and 138 deletions
30
libcockatrice_protocol/npm/README.md
Normal file
30
libcockatrice_protocol/npm/README.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# @cockatrice/protocol
|
||||
|
||||
Network protocol artifacts for [Cockatrice](https://github.com/Cockatrice/Cockatrice): the `.proto`
|
||||
definitions used by the desktop client, Servatrice, and the webclient, plus the
|
||||
authoritative protocol version constant they all share.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install @cockatrice/protocol
|
||||
```
|
||||
|
||||
The package is published to GitHub Packages under the `@cockatrice` scope; consumers
|
||||
need an `.npmrc` entry pointing the scope at `https://npm.pkg.github.com` and a
|
||||
`GITHUB_TOKEN` with `read:packages`.
|
||||
|
||||
## Contents
|
||||
|
||||
- `pb/*.proto` — every protobuf schema file from `libcockatrice_protocol`.
|
||||
- `protocol_version.json` — `{ "protocolVersion": <int> }`. Identical to the file
|
||||
the C++ build reads via `configure_file()`.
|
||||
|
||||
## Usage (TypeScript)
|
||||
|
||||
```ts
|
||||
import protocolVersionInfo from "@cockatrice/protocol/protocol_version.json" with { type: "json" };
|
||||
export const PROTOCOL_VERSION = protocolVersionInfo.protocolVersion;
|
||||
```
|
||||
|
||||
Point your protobuf code-generator (e.g. buf) at `node_modules/@cockatrice/protocol/pb`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue