mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
fix: unified version management
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
- Changed the method of retrieving the app version in the Docker build workflow from the pyproject.toml file to the VERSION file for improved consistency and reliability. - Updated error messaging to reflect the new source of the app version.
This commit is contained in:
parent
6dd85dd365
commit
7c154784b3
3 changed files with 64 additions and 3 deletions
6
.github/workflows/docker-build.yml
vendored
6
.github/workflows/docker-build.yml
vendored
|
|
@ -40,11 +40,11 @@ jobs:
|
|||
- name: Read app version and calculate next Docker build version
|
||||
id: tag_version
|
||||
run: |
|
||||
APP_VERSION=$(grep -E '^version = ' surfsense_backend/pyproject.toml | sed 's/version = "\(.*\)"/\1/')
|
||||
echo "App version from pyproject.toml: $APP_VERSION"
|
||||
APP_VERSION=$(tr -d '[:space:]' < VERSION)
|
||||
echo "App version from VERSION file: $APP_VERSION"
|
||||
|
||||
if [ -z "$APP_VERSION" ]; then
|
||||
echo "Error: Could not read version from surfsense_backend/pyproject.toml"
|
||||
echo "Error: Could not read version from VERSION file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
1
VERSION
Normal file
1
VERSION
Normal file
|
|
@ -0,0 +1 @@
|
|||
0.0.14
|
||||
60
scripts/bump-version.sh
Normal file
60
scripts/bump-version.sh
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
VERSION_FILE="$REPO_ROOT/VERSION"
|
||||
|
||||
if [ ! -f "$VERSION_FILE" ]; then
|
||||
echo "ERROR: VERSION file not found at $VERSION_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="$(tr -d '[:space:]' < "$VERSION_FILE")"
|
||||
|
||||
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
|
||||
echo "ERROR: '$VERSION' is not valid semver (expected X.Y.Z)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Bumping all packages to $VERSION"
|
||||
echo "---------------------------------"
|
||||
|
||||
bump_json() {
|
||||
local file="$1"
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " SKIP $file (not found)"
|
||||
return
|
||||
fi
|
||||
local old
|
||||
old="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$file" | head -1)"
|
||||
if [ "$old" = "$VERSION" ]; then
|
||||
echo " OK $file ($old -- already up to date)"
|
||||
else
|
||||
sed -i "s/\"version\": \"$old\"/\"version\": \"$VERSION\"/" "$file"
|
||||
echo " SET $file ($old -> $VERSION)"
|
||||
fi
|
||||
}
|
||||
|
||||
bump_toml() {
|
||||
local file="$1"
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " SKIP $file (not found)"
|
||||
return
|
||||
fi
|
||||
local old
|
||||
old="$(sed -n 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$file" | head -1)"
|
||||
if [ "$old" = "$VERSION" ]; then
|
||||
echo " OK $file ($old -- already up to date)"
|
||||
else
|
||||
sed -i "s/^version = \"$old\"/version = \"$VERSION\"/" "$file"
|
||||
echo " SET $file ($old -> $VERSION)"
|
||||
fi
|
||||
}
|
||||
|
||||
bump_json "$REPO_ROOT/surfsense_web/package.json"
|
||||
bump_json "$REPO_ROOT/surfsense_browser_extension/package.json"
|
||||
bump_json "$REPO_ROOT/surfsense_desktop/package.json"
|
||||
bump_toml "$REPO_ROOT/surfsense_backend/pyproject.toml"
|
||||
|
||||
echo "---------------------------------"
|
||||
echo "Done. All packages set to $VERSION"
|
||||
Loading…
Add table
Add a link
Reference in a new issue