-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from hkoller/main
Refactoring of build management
- Loading branch information
Showing
10 changed files
with
2,262 additions
and
88 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,15 @@ | ||
name: 'Set versions' | ||
description: 'Sets env variables with various software versions used in the workflows' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: "set UV version" | ||
shell: bash | ||
run: echo "VERSION_UV=0.5.25" >> $GITHUB_ENV | ||
|
||
- name: "set Julia version" | ||
shell: bash | ||
run: echo "VERSION_JULIA=1.11.2" >> $GITHUB_ENV | ||
|
||
|
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
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
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 @@ | ||
3.13 |
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
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,53 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
RED="\e[31m" | ||
GREEN="\e[32m" | ||
BLUE="\e[94m" | ||
ENDCOLOR="\e[0m" | ||
|
||
# make sure the git repo is clean | ||
test -z "$(git status --porcelain)" || (echo -e "${RED}Repository is dirty. Aborting. ${ENDCOLOR}" && exit 1) | ||
|
||
# store current git hash for undo command | ||
current_git_hash=$(git show --oneline -s | cut -f 1 -d" ") | ||
undo_command="git reset --hard $current_git_hash" | ||
echo -e "If anything goes wrong use $BLUE $undo_command $ENDCOLOR to reset your repository." | ||
|
||
# Get the current version from pyproject.toml and make sure it is a .dev version | ||
version="$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)" | ||
echo "Current Project version is $version" | ||
if [[ ! $version == *".dev"* ]]; then | ||
echo -e "${RED}$version is no dev version. Aborting.${ENDCOLOR}" | ||
exit 1 | ||
fi | ||
|
||
# Determine release version | ||
version="$(echo $version | sed 's/\.dev.*$//')" | ||
|
||
# Ask user | ||
echo -e "Release version ${GREEN} $version ${ENDCOLOR} ? [y/N]" | ||
read answer | ||
if [[ ! $answer =~ ^[Yy]$ ]] ; then | ||
echo "Aborted" && exit 1 | ||
fi | ||
|
||
# Switch pyproject.toml to release version and commit | ||
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $version | ||
git commit -am"Tag release version $version" | ||
|
||
# Tag this version | ||
tag="v$version" | ||
echo "Creating tag: $tag" | ||
git tag $tag | ||
|
||
# Start the next dev version | ||
new_version="$(echo $version | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')".dev0 | ||
|
||
echo "Starting new version: $new_version" | ||
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $new_version | ||
git commit -am"Start developing version $new_version" | ||
|
||
echo -e "Tag created. Use $BLUE git push --tags $ENDCOLOR to make this release permanent" | ||
echo -e "Or undo all changes with $GREEN $undo_command && git tag --delete $tag $ENDCOLOR" | ||
|
Oops, something went wrong.