-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bvandekerkhof <[email protected]>
- Loading branch information
1 parent
e571a5f
commit cfe5763
Showing
4 changed files
with
60 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import re | ||
|
||
with open("pyproject.toml", "r") as file: | ||
version_content = file.read() | ||
# Match regex for <version="0.0.0a",> pattern | ||
current_semantic_version = re.findall(r'version = "(\d+\.\d+\.[a-zA-Z0-9]+)"', version_content) | ||
major_version, minor_version, patch_version = current_semantic_version[0].split(".") | ||
patch_version = int(re.findall(r"\d+", patch_version)[0]) | ||
output_semantic_version = f"{major_version}.{minor_version}.{patch_version}" | ||
print(output_semantic_version) # Print is required for release in GitHub action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-FileCopyrightText: 2024 Shell Global Solutions International B.V. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: ManualReleaseTag | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# Releases new Python version | ||
Release: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Specify all python versions you might want to perform the actions on | ||
python-version: [ "3.11" ] | ||
steps: | ||
# Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Get version | ||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.PYELQ_TOKEN }} | ||
id: version | ||
run: | | ||
version=$(python .github/get_version.py) | ||
echo "BUMPED_VERSION=$(echo v$version)" >> $GITHUB_ENV | ||
echo "New version: $version" | ||
- name: Create Release | ||
run: gh release create ${{ env.BUMPED_VERSION }} --generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PYELQ_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,17 +25,12 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Bump version and commit bumped version back to branch | ||
- name: Get version | ||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.PYELQ_TOKEN }} | ||
id: version | ||
run: | | ||
version=$(python .github/bump_version.py) | ||
git config --global user.name 'bump_version' | ||
git config --global user.email '[email protected]' | ||
git remote set-url origin "https://[email protected]/$GITHUB_REPOSITORY" | ||
git commit --signoff -am "Bumped minor version" | ||
git push | ||
version=$(python .github/get_version.py) | ||
echo "BUMPED_VERSION=$(echo v$version)" >> $GITHUB_ENV | ||
echo "New version: $version" | ||
- name: Create Release | ||
|