diff --git a/.github/labeler.yml b/.github/labeler.yml index 9b7d480c0e..60f72803aa 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,8 +1,6 @@ "backend": - - all: - - changed-files: - - any-glob-to-any-file: [photon-core/**, photon-server/**] - - all-globs-to-all-files: "!photon-server/src/main/resources/web/index.html" + - changed-files: + - any-glob-to-any-file: [photon-core/**, photon-server/**] "documentation": - changed-files: - any-glob-to-any-file: [docs/**, photon-docs/**] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f8235367d..f36fc229ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,33 +17,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: gradle/actions/wrapper-validation@v4 - - build-client: - name: "PhotonClient Build" - defaults: - run: - working-directory: photon-client - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - cache-dependency-path: photon-client/pnpm-lock.yaml - - name: Install Dependencies - run: pnpm i --frozen-lockfile - - name: Build Production Client - run: pnpm run build - - uses: actions/upload-artifact@v4 - with: - name: built-client - path: photon-client/dist/ build-examples: strategy: @@ -100,6 +73,14 @@ jobs: with: java-version: 17 distribution: temurin + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 - name: Install mrcal deps run: sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5 - name: Gradle Build @@ -276,7 +257,7 @@ jobs: path: output/*.zip build-package: - needs: [build-client, build-gradle, build-offline-docs] + needs: [build-gradle, build-offline-docs] strategy: fail-fast: false @@ -316,21 +297,19 @@ jobs: java-version: 17 distribution: temurin architecture: ${{ matrix.architecture }} + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: photon-client/pnpm-lock.yaml - name: Install Arm64 Toolchain run: ./gradlew installArm64Toolchain if: ${{ (matrix.artifact-name) == 'LinuxArm64' }} - - run: | - rm -rf photon-server/src/main/resources/web/* - mkdir -p photon-server/src/main/resources/web/docs - if: ${{ (matrix.os) != 'windows-latest' }} - - run: | - del photon-server\src\main\resources\web\*.* - mkdir photon-server\src\main\resources\web\docs - if: ${{ (matrix.os) == 'windows-latest' }} - - uses: actions/download-artifact@v4 - with: - name: built-client - path: photon-server/src/main/resources/web/ - uses: actions/download-artifact@v4 with: name: built-docs diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index e703957049..350bf38861 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -83,15 +83,3 @@ jobs: run: pnpm run lint-ci - name: Check Formatting run: pnpm run format-ci - server-index: - name: "Check server index.html not changed" - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Fetch all history and metadata - run: | - git fetch --prune --unshallow - git checkout -b pr - git branch -f main origin/main - - name: Check index.html not changed - run: git --no-pager diff --exit-code origin/main photon-server/src/main/resources/web/index.html diff --git a/docs/source/docs/contributing/building-photon.md b/docs/source/docs/contributing/building-photon.md index 7f5738d3dd..41ec668e13 100644 --- a/docs/source/docs/contributing/building-photon.md +++ b/docs/source/docs/contributing/building-photon.md @@ -43,26 +43,6 @@ In the photon-client directory: pnpm install ``` -### Build and Copy UI to Java Source - -In the root directory: - -```{eval-rst} -.. tab-set:: - - .. tab-item:: Linux - - ``./gradlew buildAndCopyUI`` - - .. tab-item:: macOS - - ``./gradlew buildAndCopyUI`` - - .. tab-item:: Windows (cmd) - - ``gradlew buildAndCopyUI`` -``` - ### Using hot reload on the UI In the photon-client directory: diff --git a/photon-server/build.gradle b/photon-server/build.gradle index f605532e37..801bbc6f12 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -26,6 +26,8 @@ jar { } shadowJar { + dependsOn 'buildAndCopyUI' + archiveBaseName = "photonvision" archiveVersion = project.version as String archiveClassifier.set(wpilibTools.currentPlatform.platformName) @@ -44,6 +46,8 @@ tasks.register('copyClientUIToResources', Copy) { } tasks.register('buildClient', PnpmTask) { + inputs.dir fileTree(dir: "${projectDir}/../photon-client", exclude: "dist/") + outputs.dir file("${projectDir}/../photon-client/dist") args = ["build"] dependsOn "pnpmInstall" } @@ -53,6 +57,10 @@ tasks.register('buildAndCopyUI') { finalizedBy "copyClientUIToResources" } +processResources { + dependsOn copyClientUIToResources +} + run { environment "PATH_PREFIX", "../" diff --git a/photon-server/src/main/resources/web/index.html b/photon-server/src/main/resources/web/index.html deleted file mode 100644 index 641b6da394..0000000000 --- a/photon-server/src/main/resources/web/index.html +++ /dev/null @@ -1 +0,0 @@ -
UIs should be copied, but yours wasn't!