From 7dd6610dba9b492ae769050c5d2ddc2f9a2f2cc8 Mon Sep 17 00:00:00 2001 From: Jared Lewis Date: Thu, 11 Apr 2024 15:06:09 +1000 Subject: [PATCH] chore: Use sed to replace version identifier --- .github/workflows/bump.yaml | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump.yaml b/.github/workflows/bump.yaml index 8737752..96b1b31 100644 --- a/.github/workflows/bump.yaml +++ b/.github/workflows/bump.yaml @@ -52,8 +52,9 @@ jobs: # Bump BASE_VERSION=`poetry version -s` - NEW_VERSION=`poetry version -s ${{ github.event.inputs.bump_rule }}` + NEW_VERSION=`poetry version -s ${{ github.event.inputs.bump_rule }} --dry-run` echo "Bumping version $BASE_VERSION > $NEW_VERSION" + sed -i "s/version = \"$BASE_VERSION\"/version = \"$NEW_VERSION\"/g" pyproject.toml poetry run towncrier build --yes --version v$NEW_VERSION git commit -a -m "bump: version $BASE_VERSION -> $NEW_VERSION" git tag v$NEW_VERSION @@ -61,7 +62,8 @@ jobs: # Bump to alpha (so that future commits do not have the same # version as the tagged commit) BASE_VERSION=`poetry version -s` - NEW_VERSION=`poetry version -s prerelease` + NEW_VERSION=`poetry version -s prerelease --dry-run` echo "Bumping version $BASE_VERSION > $NEW_VERSION" + sed -i "s/version = \"$BASE_VERSION\"/version = \"$NEW_VERSION\"/g" pyproject.toml git commit -a -m "bump(pre-release): version $BASE_VERSION > $NEW_VERSION" git push && git push --tags diff --git a/pyproject.toml b/pyproject.toml index 6a247be..1f4de34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ # TODO: work out how to do this well (https://gitlab.com/magicc/copier-fgen-based-repository/-/issues/1) [project] name = "fgen-example" -version = "0.1.0" +version = "0.2.1a11" description = "Example project using fgen to wrap a simple module" readme = "README.md" authors = [{name = "Jared Lewis, email = jared.lewis@climate-resource.com"}]