Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Puppeteer
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
to be continuous...
Puppeteer
Commits
375932db
Commit
375932db
authored
2 years ago
by
Pierre Smeyers
Browse files
Options
Downloads
Patches
Plain Diff
chore(sem-rel): major and minor version aliases
parent
e5f8e96f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.releaserc.yml
+2
-1
2 additions, 1 deletion
.releaserc.yml
post-release.sh
+35
-0
35 additions, 0 deletions
post-release.sh
with
37 additions
and
1 deletion
.releaserc.yml
+
2
−
1
View file @
375932db
...
@@ -6,7 +6,8 @@ plugins: [
...
@@ -6,7 +6,8 @@ plugins: [
[
[
"
@semantic-release/exec"
,
"
@semantic-release/exec"
,
{
{
"
prepareCmd"
:
"
./bumpversion.sh
\"
${lastRelease.version}
\"
\"
${nextRelease.version}
\"
\"
${nextRelease.type}
\"
"
"
prepareCmd"
:
"
./bumpversion.sh
\"
${lastRelease.version}
\"
\"
${nextRelease.version}
\"
\"
${nextRelease.type}
\"
"
,
"
successCmd"
:
"
./post-release.sh
\"
${nextRelease.version}
\"
"
}
}
],
],
[
[
...
...
This diff is collapsed.
Click to expand it.
post-release.sh
0 → 100755
+
35
−
0
View file @
375932db
#!/usr/bin/env bash
function
log_info
()
{
>
&2
echo
-e
"[
\\
e[1;94mINFO
\\
e[0m]
$*
"
}
function
log_warn
()
{
>
&2
echo
-e
"[
\\
e[1;93mWARN
\\
e[0m]
$*
"
}
function
log_error
()
{
>
&2
echo
-e
"[
\\
e[1;91mERROR
\\
e[0m]
$*
"
}
# check number of arguments
if
[[
"$#"
-lt
1
]]
;
then
log_error
"Missing arguments"
log_error
"Usage:
$0
<next version>"
exit
1
fi
nextVer
=
$1
minorVer
=
${
nextVer
%\.[0-9]*
}
majorVer
=
${
nextVer
%\.[0-9]*\.[0-9]*
}
log_info
"Creating minor version tag alias
\\
e[33;1m
${
minorVer
}
\\
e[0m from
$nextVer
..."
git tag
--force
-a
"
$minorVer
"
"
$nextVer
"
-m
"Minor version alias (targets
$nextVer
)"
log_info
"Creating major version tag alias
\\
e[33;1m
${
majorVer
}
\\
e[0m from
$nextVer
..."
git tag
--force
-a
"
$majorVer
"
"
$nextVer
"
-m
"Major version alias (targets
$nextVer
)"
log_info
"Pushing tags..."
git_base_url
=
$(
echo
"
$CI_REPOSITORY_URL
"
|
cut
-d
\@
-f2
)
git_auth_url
=
"https://token:
${
GITLAB_TOKEN
}
@
${
git_base_url
}
"
git push
--tags
--force
"
$git_auth_url
"
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