mirror of
https://github.com/acaloiaro/ess
synced 2026-07-21 10:12:19 +00:00
chore: use version.txt rather than modifying source code on bump
Signed-off-by: Juan C. Müller <me@juancmuller.com>
This commit is contained in:
parent
44a904c668
commit
16eda61926
3 changed files with 18 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{pkgs ? import <nixpkgs> {}, ...}:
|
||||
pkgs.buildGoModule {
|
||||
pname = "ess";
|
||||
version = "2.16.4";
|
||||
version = pkgs.lib.strings.removeSuffix "\n" (builtins.readFile ./version.txt);
|
||||
src = ./.;
|
||||
vendorHash = null;
|
||||
|
||||
|
|
|
|||
30
flake.nix
30
flake.nix
|
|
@ -45,20 +45,22 @@
|
|||
scripts = {
|
||||
prepare-release = {
|
||||
description = "prepare a release";
|
||||
exec = ''
|
||||
git config --global user.email 'actions@github.com'
|
||||
git config --global user.name 'Github Actions'
|
||||
OLD_TAG=$(svu current | sed 's/^v//g')
|
||||
NEW_TAG=$(svu next | sed 's/^v//g')
|
||||
[ "$OLD_TAG" == "$NEW_TAG" ] && echo "no version bump" && exit 0
|
||||
echo default.nix README.md | xargs sed -i "s/$OLD_TAG/$NEW_TAG/g"
|
||||
echo default.nix README.md | xargs sed -i "s/v$OLD_TAG/v$NEW_TAG/g"
|
||||
git add default.nix README.md
|
||||
git commit -m "bump release version" --allow-empty
|
||||
git tag v$NEW_TAG
|
||||
git push
|
||||
git push --tags
|
||||
'';
|
||||
exec =
|
||||
# bash
|
||||
''
|
||||
git config --global user.email 'actions@github.com'
|
||||
git config --global user.name 'Github Actions'
|
||||
OLD_VERSION=$(svu current --tag.prefix "")
|
||||
NEW_VERSION=$(svu next --tag.prefix "" --always)
|
||||
[ "$OLD_VERSION" == "$NEW_VERSION" ] && echo "no version bump" && exit 0
|
||||
sed -i "s/$OLD_VERSION/$NEW_VERSION/g" README.md
|
||||
echo "$NEW_VERSION" >version.txt
|
||||
git add version.txt README.md
|
||||
git commit -m "bump release version" --allow-empty
|
||||
git tag v$NEW_VERSION
|
||||
git push
|
||||
git push --tags
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
1
version.txt
Normal file
1
version.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
2.16.4
|
||||
Loading…
Reference in a new issue