Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
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
俞永鹏
openzeppelin-contracts-upgradeable
Commits
5803e116
Commit
5803e116
authored
Nov 17, 2020
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve script to version changelog
parent
b33372cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
release.sh
scripts/release/release.sh
+1
-1
update-changelog-release-date.js
scripts/release/update-changelog-release-date.js
+10
-2
No files found.
scripts/release/release.sh
View file @
5803e116
...
...
@@ -17,7 +17,7 @@ current_version() {
current_release_branch
()
{
v
=
"
$(
current_version
)
"
echo
"release-
${
v
%
%
-
"
$PRERELEASE_SUFFIX
"
.*
}
"
echo
"release-
${
v
%
.*
-
"
$PRERELEASE_SUFFIX
"
.*
}
"
}
assert_current_branch
()
{
...
...
scripts/release/update-changelog-release-date.js
View file @
5803e116
...
...
@@ -6,6 +6,8 @@
const
fs
=
require
(
'fs'
);
const
cp
=
require
(
'child_process'
);
const
suffix
=
process
.
env
.
PRERELEASE_SUFFIX
||
'rc'
;
const
changelog
=
fs
.
readFileSync
(
'CHANGELOG.md'
,
'utf8'
);
// The changelog entry to be updated looks like this:
...
...
@@ -13,15 +15,21 @@ const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
// We need to add the version and release date in a YYYY-MM-DD format, so that it looks like this:
// ## 2.5.3 (2019-04-25)
const
pkg
=
require
(
'../../package.json'
);
const
version
=
pkg
.
version
.
replace
(
new
RegExp
(
'-'
+
suffix
+
'
\\
..*'
),
''
);
const
unreleased
=
/^## Unreleased$/im
;
const
released
=
new
RegExp
(
`^##
${
version
}
\\([-\\d]*\\)$`
,
'm'
);
if
(
released
.
test
(
changelog
))
{
process
.
exit
(
0
);
}
if
(
!
unreleased
.
test
(
changelog
))
{
console
.
error
(
'Missing changelog entry'
);
process
.
exit
(
1
);
}
const
{
version
}
=
require
(
'../../package.json'
);
fs
.
writeFileSync
(
'CHANGELOG.md'
,
changelog
.
replace
(
unreleased
,
`##
${
version
}
(
${
new
Date
().
toISOString
().
split
(
'T'
)[
0
]}
)`
),
...
...
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