diff --git a/.github/workflows/build_htdocs.yml b/.github/workflows/build_htdocs.yml deleted file mode 100644 index da921442..00000000 --- a/.github/workflows/build_htdocs.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build htdocs - -on: - push: - branches: - - master - paths: - - 'web-src/**' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies - working-directory: web-src - run: npm install - - # Build for production with minification (will update web interface - # in "../htdocs") - - name: Build htdocs - working-directory: web-src - run: npm run build - - - name: Count changed files - id: count - run: | - git add htdocs/ - git diff --numstat --staged > diffstat - test -s diffstat || { echo "Warning: Push to web-src did not change htdocs"; exit 1; } - - # The GH action email is from https://github.com/orgs/community/discussions/26560 - - name: Commit and push updated assets - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git commit -m "[web] Rebuild web interface" - git push diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index f20ec137..d0791281 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -28,7 +28,7 @@ jobs: uses: vmactions/freebsd-vm@v1 with: prepare: | - pkg install -y gmake autoconf automake libtool pkgconf gettext gperf glib ffmpeg libconfuse libevent libxml2 libgcrypt libunistring libiconv curl libplist libinotify avahi sqlite3 alsa-lib libsodium json-c libwebsockets protobuf-c bison flex + pkg install -y gmake autoconf automake libtool pkgconf gettext gperf glib ffmpeg libconfuse libevent libxml2 libgcrypt libunistring libiconv curl libplist libinotify avahi sqlite3 alsa-lib libsodium json-c libwebsockets protobuf-c bison flex node npm pw user add owntone -m -d /usr/local/var/cache/owntone run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ddb71bc9..1fad5927 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -36,6 +36,7 @@ jobs: make make check make distcheck + make web-check - name: Install run: | diff --git a/Makefile.am b/Makefile.am index 43efd0f2..41dbc90c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -120,6 +120,8 @@ web-update: $(MAKE) web-update -C web-src web-serve: $(MAKE) web-serve -C web-src +web-check: + $(MAKE) web-check -C web-src web-lint: $(MAKE) web-lint -C web-src web-format: diff --git a/web-src/Makefile.am b/web-src/Makefile.am index 2f0eb4fe..dad58aa7 100644 --- a/web-src/Makefile.am +++ b/web-src/Makefile.am @@ -191,8 +191,24 @@ web-serve: node_modules web-update: $(if $(NPM),$(NPM) update) +web-check: + @echo "Verifying that all source files in 'src' and 'public' are listed in WEB_FILES ..." + @unexpected_files=0; \ + for file in $$(find public src -type f); do \ + if ! echo " $(WEB_FILES) " | grep -q " $$file "; then \ + echo "Unknown web interface source file found: $$file"; \ + unexpected_files=1; \ + fi; \ + done; \ + if [ $$unexpected_files -eq 0 ]; then \ + echo "All source files listed in WEB_FILES."; \ + else \ + echo "FAILURE: Unknown web interface source files found, please add them to WEB_FILES."; \ + exit 1; \ + fi + web-lint: node_modules - $(if $(NPM),$(NPM) run lint) + $(if $(NPM),$(NPM) run lint --no-fix) web-format: node_modules $(if $(NPM),$(NPM) run format)