Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
f8a304ba
Commit
f8a304ba
authored
Apr 19, 2026
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(release): inject build version into artifacts
parent
cfe2cf4c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
21 deletions
+27
-21
build-canary-image.yml
.github/workflows/build-canary-image.yml
+3
-0
release.yml
.github/workflows/release.yml
+1
-1
.release-please-manifest.json
.release-please-manifest.json
+1
-1
CHANGELOG.md
CHANGELOG.md
+0
-7
version.go
internal/version/version.go
+5
-3
Dockerfile
scripts/Dockerfile
+2
-2
migrator.go
store/migrator.go
+15
-7
No files found.
.github/workflows/build-canary-image.yml
View file @
f8a304ba
...
...
@@ -95,6 +95,9 @@ jobs:
context
:
.
file
:
./scripts/Dockerfile
platforms
:
${{ matrix.platform }}
build-args
:
|
VERSION=canary
COMMIT=${{ github.sha }}
cache-from
:
type=gha,scope=build-${{ matrix.platform }}
cache-to
:
type=gha,mode=max,scope=build-${{ matrix.platform }}
outputs
:
type=image,name=neosmemo/memos,push-by-digest=true,name-canonical=true,push=true
...
...
.github/workflows/release.yml
View file @
f8a304ba
...
...
@@ -161,7 +161,7 @@ jobs:
go build \
-trimpath \
-ldflags="-s -w -X github.com/usememos/memos/internal/version.Version=${{ needs.prepare.outputs.version }} -extldflags '-static'" \
-ldflags="-s -w -X github.com/usememos/memos/internal/version.Version=${{ needs.prepare.outputs.version }} -
X github.com/usememos/memos/internal/version.Commit=${{ github.sha }} -
extldflags '-static'" \
-tags netgo,osusergo \
-o "build/${output_name}" \
./cmd/memos
...
...
.release-please-manifest.json
View file @
f8a304ba
{
"."
:
"0.27.
1
"
"."
:
"0.27.
0
"
}
CHANGELOG.md
View file @
f8a304ba
# Changelog
## [0.27.1](https://github.com/usememos/memos/compare/v0.27.0...v0.27.1) (2026-04-19)
### Bug Fixes
*
mixed-case user resource names (
[
#5853
](
https://github.com/usememos/memos/issues/5853
)
) (
[
01be01f
](
https://github.com/usememos/memos/commit/01be01f4b7676af41bdd1758b1e9b096aa922546
)
)
## [0.27.0](https://github.com/usememos/memos/compare/v0.26.2...v0.27.0) (2026-04-18)
...
...
internal/version/version.go
View file @
f8a304ba
...
...
@@ -7,9 +7,11 @@ import (
"golang.org/x/mod/semver"
)
// Version is the service current released version.
// Semantic versioning: https://semver.org/
var
Version
=
"0.27.0"
// Version is set by release builds and defaults to a development build marker.
var
Version
=
"dev"
// Commit is set by CI builds and defaults to an unknown revision marker.
var
Commit
=
"unknown"
func
GetCurrentVersion
()
string
{
return
Version
...
...
scripts/Dockerfile
View file @
f8a304ba
...
...
@@ -14,13 +14,13 @@ COPY . .
# Please build frontend first, so that the static files are available.
# Refer to `pnpm release` in package.json for the build command.
ARG
TARGETOS TARGETARCH VERSION
COMMIT
ARG
TARGETOS TARGETARCH VERSION
=dev COMMIT=unknown
RUN
--mount
=
type
=
cache,target
=
/go/pkg/mod
\
--mount
=
type
=
cache,target
=
/root/.cache/go-build
\
CGO_ENABLED
=
0
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
\
go build
\
-trimpath
\
-ldflags
=
"-s -w -extldflags '-static'"
\
-ldflags
=
"-s -w -
X github.com/usememos/memos/internal/version.Version=
${
VERSION
}
-X github.com/usememos/memos/internal/version.Commit=
${
COMMIT
}
-
extldflags '-static'"
\
-tags
netgo,osusergo
\
-o
memos
\
./cmd/memos
...
...
store/migrator.go
View file @
f8a304ba
...
...
@@ -295,19 +295,27 @@ func (s *Store) seed(ctx context.Context) error {
return
tx
.
Commit
()
}
// GetCurrentSchemaVersion returns the latest schema version available for the configured database driver.
func
(
s
*
Store
)
GetCurrentSchemaVersion
()
(
string
,
error
)
{
currentVersion
:=
version
.
GetCurrentVersion
()
minorVersion
:=
version
.
GetMinorVersion
(
currentVersion
)
filePaths
,
err
:=
fs
.
Glob
(
migrationFS
,
fmt
.
Sprintf
(
"%s%s/*.sql"
,
s
.
getMigrationBasePath
(),
minorVersion
))
filePaths
,
err
:=
fs
.
Glob
(
migrationFS
,
fmt
.
Sprintf
(
"%s*/*.sql"
,
s
.
getMigrationBasePath
()))
if
err
!=
nil
{
return
""
,
errors
.
Wrap
(
err
,
"failed to read migration files"
)
}
slices
.
Sort
(
filePaths
)
if
len
(
filePaths
)
==
0
{
return
fmt
.
Sprintf
(
"%s.0"
,
minorVersion
),
nil
return
defaultSchemaVersion
,
nil
}
currentSchemaVersion
:=
defaultSchemaVersion
for
_
,
filePath
:=
range
filePaths
{
fileSchemaVersion
,
err
:=
s
.
getSchemaVersionOfMigrateScript
(
filePath
)
if
err
!=
nil
{
return
""
,
errors
.
Wrap
(
err
,
"failed to get schema version of migrate script"
)
}
if
version
.
IsVersionGreaterThan
(
fileSchemaVersion
,
currentSchemaVersion
)
{
currentSchemaVersion
=
fileSchemaVersion
}
}
return
s
.
getSchemaVersionOfMigrateScript
(
filePaths
[
len
(
filePaths
)
-
1
])
return
currentSchemaVersion
,
nil
}
// getSchemaVersionOfMigrateScript extracts the schema version from the migration script file path.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment