From 553bc8440453b8118f8cb0a399d4b32d854f21fa Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 24 Oct 2025 01:36:30 -0400 Subject: [PATCH] release(v1.6.4): runtime version injection + CI bump/sync; caching tweaks --- .github/workflows/sync-changelog.yml | 58 ++++++++++++++++++++++------ CHANGELOG.md | 18 +++++++++ public/.htaccess | 6 +++ public/index.html | 1 + public/js/adminPanel.js | 2 +- public/js/version.js | 2 + 6 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 public/js/version.js diff --git a/.github/workflows/sync-changelog.yml b/.github/workflows/sync-changelog.yml index 4550c73..2ac68a8 100644 --- a/.github/workflows/sync-changelog.yml +++ b/.github/workflows/sync-changelog.yml @@ -1,5 +1,4 @@ ---- -name: Sync Changelog to Docker Repo +name: Bump version and sync Changelog to Docker Repo on: push: @@ -10,35 +9,70 @@ permissions: contents: write jobs: - sync: + bump_and_sync: runs-on: ubuntu-latest steps: - - name: Checkout FileRise - uses: actions/checkout@v4 - with: - path: file-rise + - uses: actions/checkout@v4 + + - name: Extract version from commit message + id: ver + run: | + MSG="${{ github.event.head_commit.message }}" + if [[ "$MSG" =~ release\((v[0-9]+\.[0-9]+\.[0-9]+)\) ]]; then + echo "version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT + echo "Found version: ${BASH_REMATCH[1]}" + else + echo "version=" >> $GITHUB_OUTPUT + echo "No release(vX.Y.Z) tag in commit message; skipping bump." + fi + + - name: Update public/js/version.js + if: steps.ver.outputs.version != '' + run: | + cat > public/js/version.js <<'EOF' + // generated by CI + window.APP_VERSION = '${{ steps.ver.outputs.version }}'; + EOF + + - name: Commit version.js (if changed) + if: steps.ver.outputs.version != '' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add public/js/version.js + if git diff --cached --quiet; then + echo "No changes to commit" + else + git commit -m "chore: set APP_VERSION to ${{ steps.ver.outputs.version }}" + git push + fi - name: Checkout filerise-docker + if: steps.ver.outputs.version != '' uses: actions/checkout@v4 with: repository: error311/filerise-docker token: ${{ secrets.PAT_TOKEN }} path: docker-repo - - name: Copy CHANGELOG.md + - name: Copy CHANGELOG.md and write VERSION + if: steps.ver.outputs.version != '' run: | - cp file-rise/CHANGELOG.md docker-repo/CHANGELOG.md + cp CHANGELOG.md docker-repo/CHANGELOG.md + echo "${{ steps.ver.outputs.version }}" > docker-repo/VERSION - - name: Commit & push + - name: Commit & push to docker repo + if: steps.ver.outputs.version != '' working-directory: docker-repo run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add CHANGELOG.md + git add CHANGELOG.md VERSION if git diff --cached --quiet; then echo "No changes to commit" else - git commit -m "chore: sync CHANGELOG.md from FileRise" + git commit -m "chore: sync CHANGELOG.md and VERSION (${{ steps.ver.outputs.version }}) from FileRise" git push origin main fi + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b9289b..d92de99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## Changes 10/24/2025 (v1.6.4) + +release(v1.6.4): runtime version injection + CI bump/sync; caching tweaks + +- Add public/js/version.js (default "dev") and load it before main.js. +- adminPanel.js: replace hard-coded string with `window.APP_VERSION || "dev"`. +- public/.htaccess: add no-cache for js/version.js +- GitHub Actions: replace sync job with “Bump version and sync Changelog to Docker Repo”. + - Parse commit msg `release(vX.Y.Z)` -> set step output `version`. + - Write `public/js/version.js` with `window.APP_VERSION = ''`. + - Commit/push version.js if changed. + - Mirror CHANGELOG.md to filerise-docker and write a VERSION file with ``. + - Guard all steps with `if: steps.ver.outputs.version != ''` to no-op on non-release commits. + +This wires the UI version label to CI, keeps dev builds showing “dev”, and feeds the Docker repo with CHANGELOG + VERSION for builds. + +--- + ## Changes 10/24/2025 (v1.6.3) release(v1.6.3): drag/drop card persistence, admin UX fixes, and docs (closes #58) diff --git a/public/.htaccess b/public/.htaccess index dd58d5e..73758ba 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -50,6 +50,12 @@ RewriteEngine On Header set Cache-Control "public, max-age=3600, must-revalidate" + # version.js should always revalidate (it changes on releases) + + Header set Cache-Control "no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "0" + # ----------------------------- diff --git a/public/index.html b/public/index.html index b7c878b..533c996 100644 --- a/public/index.html +++ b/public/index.html @@ -563,6 +563,7 @@ + diff --git a/public/js/adminPanel.js b/public/js/adminPanel.js index 7666aab..8447471 100644 --- a/public/js/adminPanel.js +++ b/public/js/adminPanel.js @@ -4,7 +4,7 @@ import { loadAdminConfigFunc } from './auth.js'; import { showToast, toggleVisibility, attachEnterKeyListener } from './domUtils.js'; import { sendRequest } from './networkUtils.js'; -const version = "v1.6.3"; +const version = window.APP_VERSION || "dev"; const adminTitle = `${t("admin_panel")} ${version}`; diff --git a/public/js/version.js b/public/js/version.js new file mode 100644 index 0000000..77631f2 --- /dev/null +++ b/public/js/version.js @@ -0,0 +1,2 @@ +// default for dev +window.APP_VERSION = "dev"; \ No newline at end of file