From 2ea4da0f1ec679f6c39dccdb45f9a689a38db78f Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 10 Nov 2024 09:56:47 -0800 Subject: [PATCH] Publish vendor JSON as released artifact (#1525) --- .github/workflows/build.yml | 51 +++++++++++++++++++ .../design-descriptions/time-sync.md | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7543c7b68e..8bc365eeb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,6 +133,37 @@ jobs: with: name: built-docs path: docs/build/html + + build-photonlib-vendorjson: + name: "Build Vendor JSON" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Java 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + + # grab all tags + - run: git fetch --tags --force + + # Generate the JSON and give it the ""standard""" name maven gives it + - run: | + chmod +x gradlew + ./gradlew photon-lib:generateVendorJson + export VERSION=$(git describe --tags --match=v*) + mv photon-lib/build/generated/vendordeps/photonlib.json photon-lib/build/generated/vendordeps/photonlib-$(git describe --tags --match=v*).json + + # Upload it here so it shows up in releases + - uses: actions/upload-artifact@v4 + with: + name: photonlib-vendor-json + path: photon-lib/build/generated/vendordeps/photonlib-*.json + build-photonlib-host: env: MACOSX_DEPLOYMENT_TARGET: 13 @@ -507,6 +538,11 @@ jobs: with: merge-multiple: true pattern: photonlib-offline + # Download vendor json + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + pattern: photonlib-vendor-json # Download all images - uses: actions/download-artifact@v4 with: @@ -546,3 +582,18 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + dispatch: + name: dispatch + needs: [build-photonlib-vendorjson] + runs-on: ubuntu-22.04 + steps: + - uses: peter-evans/repository-dispatch@v3 + if: | + github.repository == 'PhotonVision/photonvision' && + startsWith(github.ref, 'refs/tags/v') + with: + token: ${{ secrets.VENDOR_JSON_REPO_PUSH_TOKEN }} + repository: PhotonVision/vendor-json-repo + event-type: tag + client-payload: '{"run_id": "${{ github.run_id }}", "package_version": "${{ github.ref_name }}"}' diff --git a/docs/source/docs/contributing/design-descriptions/time-sync.md b/docs/source/docs/contributing/design-descriptions/time-sync.md index 3d98152a8d..507adaa922 100644 --- a/docs/source/docs/contributing/design-descriptions/time-sync.md +++ b/docs/source/docs/contributing/design-descriptions/time-sync.md @@ -101,7 +101,7 @@ The message format forgoes CRCs (as these are provided by the Ethernet physical Clients may publish statistics to NetworkTables. If they do, they shall publish to a key that is globally unique per participant in the Time Synronization network. If a client implements this, it shall provide the following publishers: | Key | Type | Notes | -| ------ | ------ | ---- | ----- | +| ------ | ------ | ---- | | offset_us | Integer | The time offset that, when added to the client's local clock, provides server time | | ping_tx_count | Integer | The total number of TSP Ping packets transmitted | | ping_rx_count | Integer | The total number of TSP Ping packets received |