Show the running version on Settings > General
The General page ends with a Version block naming the release this server runs, so an update can be confirmed from the app. The version is COBBLE_VERSION, the release tag the image was built with (Dockerfile ARG, passed by the release workflow, which falls back to package.json's version on a workflow-dispatch build), else package.json's version, which a development server reports too, with (development) after it. runningVersion (src/utils/running-version.ts) drops an unusable version string rather than showing it. Also includes the working tree's pending signup guard in src/pages/__root.server.ts: a user who still holds a session while the install has no users is sent to /auth/logout (and may load it).
This commit is contained in:
@@ -37,11 +37,20 @@ jobs:
|
||||
username: ${{ secrets.GITEA_USERNAME }}
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
# The version the app reports on Settings > General when the build
|
||||
# isn't a published release.
|
||||
- name: Read the source version
|
||||
id: source
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "version=$(sed -n -E 's/^[[:space:]]*"version": "([^"]+)",?$/\1/p' package.json | head -n1)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Work out image tags
|
||||
id: tags
|
||||
env:
|
||||
EVENT: ${{ github.event_name }}
|
||||
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||
SOURCE_VERSION: ${{ steps.source.outputs.version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sha="sha-${GITHUB_SHA::12}"
|
||||
@@ -59,10 +68,12 @@ jobs:
|
||||
"git.tben.me/moduletrace/cobble:${minor}" \
|
||||
"git.tben.me/moduletrace/cobble:${sha}")"
|
||||
else
|
||||
version="$SOURCE_VERSION"
|
||||
ghcr="ghcr.io/moduletrace/cobble:${sha}"
|
||||
gitea="git.tben.me/moduletrace/cobble:${sha}"
|
||||
fi
|
||||
{
|
||||
echo "version=$version"
|
||||
echo "ghcr<<EOF"
|
||||
echo "$ghcr"
|
||||
echo "EOF"
|
||||
@@ -79,6 +90,8 @@ jobs:
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
build-args: |
|
||||
COBBLE_VERSION=${{ steps.tags.outputs.version }}
|
||||
tags: ${{ steps.tags.outputs.ghcr }}
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
Reference in New Issue
Block a user