Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit aa51168

Browse files
committed
update create-release to use gsed when available
1 parent 3dae3db commit aa51168

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

docs/create-release.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ where `0.0.3` is an example of a new release version that needs to be replaced w
2424
This script changes a few files to update the new version. It also creates the corresponding tag and outputs
2525
the two `git` commands that need to be executed.
2626

27+
This scripts needs `gnu-sed` if you are running it from OSX.
28+
2729
Once those two commands are run, you should see a new workflow triggered in the `Actions` tab, and eventually,
2830
the new release should show up in the `releases` sections with its corresponding assests.

script/prepare-release.sh

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ set -e
44

55
# Script to prepare a new rmapi release
66

7+
SED="sed"
8+
9+
set_sed(){
10+
if $(which gsed 2>&1 >/dev/null); then
11+
SED="gsed"
12+
fi
13+
}
14+
715
update_app_version(){
816
local version=$1
9-
sed -i "s/const Version = \".*\"/const Version = \"$version\"/" version/version.go
17+
$SED -i "s/var Version = \".*\"/var Version = \"$version\"/" version/version.go
1018
}
1119

1220
update_changelog(){
1321
local version=$1
14-
sed -i "1c## rmapi $version ($(date "+%B %d, %Y"))" CHANGELOG.md
22+
$SED -i "1c## rmapi $version ($(date "+%B %d, %Y"))" CHANGELOG.md
1523
}
1624

1725
update_macosx_tutorial(){
1826
local version=$1
19-
sed -i "s/v.*\/rmapi-macosx.zip/v${version}\/rmapi-macosx.zip -o rmapi.zip/" docs/tutorial-print-macosx.md
27+
$SED -i "s/v.*\/rmapi-macosx.zip/v${version}\/rmapi-macosx.zip -o rmapi.zip/" docs/tutorial-print-macosx.md
2028
}
2129

2230
create_tag(){
@@ -42,6 +50,7 @@ if [ -z "$1" ]; then
4250
fi
4351

4452
version=$1
53+
set_sed
4554
update_app_version $version
4655
update_changelog $version
4756
update_macosx_tutorial $version

0 commit comments

Comments
 (0)