Fix protobuf github workflow (#884)
* fix: protobuf workflow * update workflow name * fixes
This commit is contained in:
@@ -15,6 +15,9 @@ on:
|
|||||||
|
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
|
||||||
|
env:
|
||||||
|
PROTOBUF_DIR: ./packages/protobufs # 👈 single source of truth
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codegen:
|
codegen:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -27,8 +30,8 @@ jobs:
|
|||||||
- name: Show files exist
|
- name: Show files exist
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
ls -la packages/ts || true
|
ls -la $PROTOBUF_DIR/packages/ts || true
|
||||||
cat packages/ts/deno.json
|
cat $PROTOBUF_DIR/packages/ts/deno.json
|
||||||
|
|
||||||
- name: Determine VERSION
|
- name: Determine VERSION
|
||||||
run: |
|
run: |
|
||||||
@@ -44,7 +47,7 @@ jobs:
|
|||||||
echo "Resolved VERSION=$STRIPPED"
|
echo "Resolved VERSION=$STRIPPED"
|
||||||
|
|
||||||
- name: Set Package Versions to current tag
|
- name: Set Package Versions to current tag
|
||||||
working-directory: packages/ts
|
working-directory: ${{ env.PROTOBUF_DIR }}/packages/ts
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
for f in deno.json; do
|
for f in deno.json; do
|
||||||
@@ -68,12 +71,11 @@ jobs:
|
|||||||
- name: Generate code
|
- name: Generate code
|
||||||
run: pnpm --filter @meshtastic/protobufs build
|
run: pnpm --filter @meshtastic/protobufs build
|
||||||
|
|
||||||
|
|
||||||
- name: Move generated .ts files and clean up
|
- name: Move generated .ts files and clean up
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
SRC_DIR="packages/protobufs/packages/ts/dist/meshtastic"
|
SRC_DIR="$PROTOBUF_DIR/packages/ts/dist/meshtastic"
|
||||||
DEST_DIR="packages/protobufs/packages/ts/dist"
|
DEST_DIR="$PROTOBUF_DIR/packages/ts/dist"
|
||||||
|
|
||||||
if [ -d "$SRC_DIR" ]; then
|
if [ -d "$SRC_DIR" ]; then
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
@@ -94,14 +96,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Copy license & README
|
- name: Copy license & README
|
||||||
run: |
|
run: |
|
||||||
cp LICENSE packages/ts
|
cp LICENSE $PROTOBUF_DIR/packages/ts
|
||||||
cp README.md packages/ts
|
cp README.md $PROTOBUF_DIR/packages/ts
|
||||||
|
|
||||||
- name: Upload TypeScript code
|
- name: Upload TypeScript code
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ts_code
|
name: ts_code
|
||||||
path: packages/ts
|
path: ${{ env.PROTOBUF_DIR }}/packages/ts
|
||||||
|
|
||||||
- name: Push to schema registry
|
- name: Push to schema registry
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -21,10 +21,12 @@ All projects are located within the `packages/` directory:
|
|||||||
- **[Hosted version](https://client.meshtastic.org)**
|
- **[Hosted version](https://client.meshtastic.org)**
|
||||||
- **`packages/core`:** Core functionality for Meshtastic JS.
|
- **`packages/core`:** Core functionality for Meshtastic JS.
|
||||||
- **`packages/transport-node`:** TCP Transport for the NodeJS runtime.
|
- **`packages/transport-node`:** TCP Transport for the NodeJS runtime.
|
||||||
|
- **`packages/transport-node-serial`:** NodeJS Serial Transport for the NodeJS runtime.
|
||||||
- **`packages/transport-deno`:** TCP Transport for the Deno runtime.
|
- **`packages/transport-deno`:** TCP Transport for the Deno runtime.
|
||||||
- **`packages/transport-http`:** HTTP Transport.
|
- **`packages/transport-http`:** HTTP Transport.
|
||||||
- **`packages/transport-web-bluetooth`:** Web Bluetooth Transport.
|
- **`packages/transport-web-bluetooth`:** Web Bluetooth Transport.
|
||||||
- **`packages/transport-web-serial`:** Web Serial Transport.
|
- **`packages/transport-web-serial`:** Web Serial Transport.
|
||||||
|
- **`packages/protobufs`:** Git submodule containing Meshtastic’s shared protobuf definitions, used to generate and publish the JSR protobuf package.
|
||||||
|
|
||||||
All `Meshtastic JS` packages (core and transports) are published both to
|
All `Meshtastic JS` packages (core and transports) are published both to
|
||||||
[JSR](https://jsr.io/@meshtastic). [NPM](https://www.npmjs.com/org/meshtastic)
|
[JSR](https://jsr.io/@meshtastic). [NPM](https://www.npmjs.com/org/meshtastic)
|
||||||
|
|||||||
Reference in New Issue
Block a user