Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/_create_github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_call:
inputs:
version:
description: 'Version to release'
required: true
type: string
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
type: string

jobs:
# create github release
create_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/create-release@v1
with:
tag_name: v${{ inputs.version }}
release_name: Release v${{ inputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/bump-my-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# notify if someone is trying to run this from any other branch than `release`
- name: Ensure on release branch
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/push_to_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag v${{ steps.get_version.outputs.version }}
git push origin v${{ steps.get_version.outputs.version }}
TAG="v${{ steps.get_version.outputs.version }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists. Skipping tag creation."
exit 0
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"
fi
outputs:
version: ${{ steps.get_version.outputs.version }}

Expand Down Expand Up @@ -76,14 +82,9 @@ jobs:
# with:
# repository-url: https://test.pypi.org/legacy/

# create github release
create_release:
name: Create GitHub Release
needs: [create_tag, publish_package]
runs-on: ubuntu-latest
steps:
- uses: actions/create-release@v1
with:
tag_name: v${{ needs.create_tag.outputs.version }}
release_name: Release v${{ needs.create_tag.outputs.version }}
draft: false
prerelease: false
uses: ./.github/workflows/_create_github_release.yml
with:
version: ${{ needs.create_tag.outputs.version }}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
All notable changes to the [mlfmu] project will be documented in this file.<br>
The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased
## [1.0.3]

### Changed

Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,16 @@ Hee Jong Park - [@LinkedIn](https://www.linkedin.com/in/heejongpark/) - <hee.jon

For your contribution, please make sure you follow the [STYLEGUIDE](STYLEGUIDE.md) before creating the Pull Request.

For a new release, a push has to be made to the release branch. The recommended practice is to merge development PRs into main, and then, when one wants to release a new version, create a PR to push main into the release branch. The push into release should now automatically trigger an update of version numbering and create tags, using the `bump_my_version` package, and release it to GitHub and PyPi.
### New releases

The recommended practice is to merge development PRs into main, and then, when one wants to release a new version, create a PR to push main into the release branch.

For a new release, please follow the next steps:

1. Create a PR to merge all desired changes from the `main` to the `release` branch.
1. After approval and merging, on GitHub, run the action "Bump version" on the `release` branch. This will create a new PR.
1. On GitHub, access the PR created by bump-my-version, check, and approve (if all looks good).
1. After approval and merging, on GitHub, run the action "Push to release" on the `release` branch. This will build everything and publish the package to PyPi, and create a new GitHub release.

Note; version numbers are in: `CHANGELOG.md`, `pyproject.toml`, and `docs/source/conf.py` (and should be automatically updated by bump-my-version upon release).

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "Kristoffer Skare, Jorge Luis Mendez, Stephanie Kemna, Melih Akdag"

# The full version, including alpha/beta/rc tags
release = "1.0.2"
release = "1.0.3"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ packages = [

[project]
name = "mlfmu"
version = "1.0.2"
version = "1.0.3"
description = "Export ML models represented as ONNX files to Functional-Mockup-Units (FMU)"
readme = "README.md"
requires-python = ">= 3.10,<3.13"
Expand Down Expand Up @@ -163,19 +163,19 @@ reportUnnecessaryTypeIgnoreComment = "information"


[tool.bumpversion]
current_version = "1.0.2"
current_version = "1.0.3"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
tag = true
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
commit = false
message = "Bump version: {current_version} → {new_version}"
commit_args = ""

Expand Down
Loading