Skip to content

Commit

Permalink
Add version update script
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Feb 27, 2024
1 parent d519565 commit 3d4782a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
7 changes: 1 addition & 6 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
- `shake-bench` is an internal testing tool, not exposed to the outside world. Thus, no version bump required for releases.
- For updating cabal files, the following script can be used:
- ```sh
# Update all `version:` fields
sed -ri "s/^version:( +)2.2.0.0/version:\12.3.0.0/" **/*.cabal
# Update all constraints expected to be in the form `== <version>`.
# We usually don't force an exact version, so this is relatively unambiguous.
# We could introduce some more ad-hoc parsing, if there is still ambiguity.
sed -ri "s/== 2.2.0.0/== 2.3.0.0/" **/*.cabal
./release/update_versions.sh <OLD_VERSION> <NEW_VERSION>
```
- It still requires manual verification and review
- [ ] generate and update changelog
Expand Down
19 changes: 19 additions & 0 deletions release/update_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -ex

function replaceHlsVersion() {
# Update all `version:` fields
sed -ri "s/^version:( +)${1}/version:\1${2}/" ./*.cabal ./**/*.cabal
# Update all constraints expected to be in the form `== <version>`.
# We usually don't force an exact version, so this is relatively unambiguous.
# We could introduce some more ad-hoc parsing, if there is still ambiguity.
sed -ri "s/== ${1}/== ${2}/" ./*.cabal ./**/*.cabal
}

if [ $# -ne 2 ];
then
echo "USAGE: ./relase/update_versions.sh <OLD_VERSION> <NEW_VERSION>"
fi

replaceHlsVersion "${1}" "${2}"

0 comments on commit 3d4782a

Please sign in to comment.