diff --git a/.github/workflows/_bump-my-version.yml b/.github/workflows/_bump-my-version.yml new file mode 100644 index 0000000..bf96952 --- /dev/null +++ b/.github/workflows/_bump-my-version.yml @@ -0,0 +1,35 @@ +name: Bump version + +on: + workflow_dispatch: + inputs: + bump-type: + description: 'Bump type' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Bump version + id: bump + uses: callowayproject/bump-my-version@master + env: + BUMPVERSION_TAG: "true" + with: + args: ${{ inputs.bump-type }} + github-token: ${{ secrets.GH_TOKEN }} + + - name: Check + if: steps.bump.outputs.bumped == 'true' + run: | + echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!" diff --git a/CHANGELOG.md b/CHANGELOG.md index b77136c..f6f8d35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e ### Changed +* Add bump-my-version for handling release versions/updating in different files. * Add README page for Examples dir, add generated FMUs for each example (given FMI tools page requirements for Examples), and update the files generated by mlfmu codegen (add for pyspark example) * Generation of modelDescription.xml file to correctly generate tags for each output with 1-indexed indexes and InitialUnknowns tags * Generation of modelDescription.xml adds the variables (inputs, parameters and outputs) in the orderer of their valueReference. This is for the indexing to work correctly diff --git a/README.md b/README.md index 67b8972..a59f6d8 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ Hee Jong Park - [@LinkedIn](https://www.linkedin.com/in/heejongpark/) - =1.0.0", "myst-parser>=4.0", "furo>=2024.8", + "bump-my-version>=0.29.0" ] native-tls = true @@ -159,3 +160,32 @@ reportUnnecessaryTypeIgnoreComment = "information" # reportConstantRedefinition = "warning" # reportImportCycles = "warning" # reportImplicitStringConcatenation = "warning" + + +[tool.bumpversion] +current_version = "1.0.2" +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" +serialize = ["{major}.{minor}.{patch}"] +search = "{current_version}" +replace = "{new_version}" +regex = false +ignore_missing_version = false +tag = false +sign_tags = false +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = false +message = "Bump version: {current_version} → {new_version}" +commit_args = "" + +[[tool.bumpversion.files]] +filename = "docs/source/conf.py" + +[[tool.bumpversion.files]] +filename = "CHANGELOG.md" +search = "## Unreleased" +replace = "## [{new_version}]" + +[[tool.bumpversion.files]] +filename = "pyproject.toml"