Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Clash Verge
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Clash Verge
Commits
6a4924bb
There was an error fetching the commit references. Please try again later.
Unverified
Commit
6a4924bb
authored
3 years ago
by
GyDi
Browse files
Options
Downloads
Patches
Plain Diff
chore: update log supports
parent
ab0d516d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
UPDATELOG.md
+11
-0
11 additions, 0 deletions
UPDATELOG.md
scripts/publish.mjs
+6
-0
6 additions, 0 deletions
scripts/publish.mjs
scripts/release.mjs
+2
-1
2 additions, 1 deletion
scripts/release.mjs
scripts/updatelog.mjs
+44
-0
44 additions, 0 deletions
scripts/updatelog.mjs
with
63 additions
and
1 deletion
UPDATELOG.md
0 → 100644
+
11
−
0
View file @
6a4924bb
## v0.0.23
### Features
-
i18n supports
-
Remote profile User Agent supports
### Bug Fixes
-
clash config file case ignore
-
clash
`external-controller`
only port
This diff is collapsed.
Click to expand it.
scripts/publish.mjs
+
6
−
0
View file @
6a4924bb
import
fs
from
"
fs-extra
"
;
import
{
createRequire
}
from
"
module
"
;
import
{
execSync
}
from
"
child_process
"
;
import
{
resolveUpdateLog
}
from
"
./updatelog.mjs
"
;
const
require
=
createRequire
(
import
.
meta
.
url
);
// publish
async
function
resolvePublish
()
{
const
flag
=
process
.
argv
[
2
]
??
"
patch
"
;
const
packageJson
=
require
(
"
../package.json
"
);
...
...
@@ -26,6 +28,10 @@ async function resolvePublish() {
packageJson
.
version
=
nextVersion
;
tauriJson
.
package
.
version
=
nextVersion
;
// 发布更新前先写更新日志
const
nextTag
=
`v
${
nextVersion
}
`
;
await
resolveUpdateLog
(
nextTag
);
await
fs
.
writeFile
(
"
./package.json
"
,
JSON
.
stringify
(
packageJson
,
undefined
,
2
)
...
...
This diff is collapsed.
Click to expand it.
scripts/release.mjs
+
2
−
1
View file @
6a4924bb
import
fetch
from
"
node-fetch
"
;
import
{
getOctokit
,
context
}
from
"
@actions/github
"
;
import
{
resolveUpdateLog
}
from
"
./updatelog.mjs
"
;
const
UPDATE_TAG_NAME
=
"
updater
"
;
const
UPDATE_JSON_FILE
=
"
update.json
"
;
...
...
@@ -34,7 +35,7 @@ async function resolveRelease() {
const
updateData
=
{
name
:
tag
.
name
,
notes
:
latestRelease
.
body
,
// use the release body directly
notes
:
await
resolveUpdateLog
(
tag
.
name
),
// use updatelog.md
pub_date
:
new
Date
().
toISOString
(),
platforms
:
{
win64
:
{
signature
:
""
,
url
:
""
},
...
...
This diff is collapsed.
Click to expand it.
scripts/updatelog.mjs
0 → 100644
+
44
−
0
View file @
6a4924bb
import
fs
from
"
fs-extra
"
;
import
path
from
"
path
"
;
const
UPDATE_LOG
=
"
UPDATELOG.md
"
;
// parse the UPDATELOG.md
export
async
function
resolveUpdateLog
(
tag
)
{
const
cwd
=
process
.
cwd
();
const
reTitle
=
/^## v
[\d\.]
+/
;
const
reEnd
=
/^---/
;
const
file
=
path
.
join
(
cwd
,
UPDATE_LOG
);
if
(
!
(
await
fs
.
pathExists
(
file
)))
{
throw
new
Error
(
"
could not found UPDATELOG.md
"
);
}
const
data
=
await
fs
.
readFile
(
file
).
then
((
d
)
=>
d
.
toString
(
"
utf8
"
));
const
map
=
{};
let
p
=
""
;
data
.
split
(
"
\n
"
).
forEach
((
line
)
=>
{
if
(
reTitle
.
test
(
line
))
{
p
=
line
.
slice
(
3
).
trim
();
if
(
!
map
[
p
])
{
map
[
p
]
=
[];
}
else
{
throw
new
Error
(
`Tag
${
p
}
dup`
);
}
}
else
if
(
reEnd
.
test
(
line
))
{
p
=
""
;
}
else
if
(
p
)
{
map
[
p
].
push
(
line
);
}
});
if
(
!
map
[
tag
])
{
throw
new
Error
(
`could not found "
${
tag
}
" in UPDATELOG.md`
);
}
return
map
[
tag
].
join
(
"
\n
"
).
trim
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment