Skip to content

Commit

Permalink
Added upload new version task
Browse files Browse the repository at this point in the history
  • Loading branch information
FaustVX committed May 18, 2024
1 parent 708a9b0 commit f0898d8
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 14 deletions.
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@
}
}
}
},
{
"label": "upload new version",
"type": "shell",
"command": "${workspaceFolder}/bump_version.sh",
"args": [
"${input:version}",
"${input:message}"
],
"windows": {
"command": "${workspaceFolder}\\bump_version.ps1"
}
}
],
"inputs": [
{
"id": "version",
"type": "promptString",
"description": "version"
},
{
"id": "message",
"type": "promptString",
"description": "commit message (optional)"
}
]
}
4 changes: 0 additions & 4 deletions bump version.bat

This file was deleted.

5 changes: 0 additions & 5 deletions bump version.ps1

This file was deleted.

5 changes: 0 additions & 5 deletions bump version.sh

This file was deleted.

22 changes: 22 additions & 0 deletions bump_version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
param (
[parameter(Mandatory)]
[String]$version,

[parameter()]
[String]$message
)

$version = "v$version"

if ($PSBoundParameters.ContainsKey('message'))
{
git commit -am "Bumped version ``$version```n$message"
}
else
{
git commit -am "Bumped version ``$version``"
}

git tag $version
git push
git push --tags
18 changes: 18 additions & 0 deletions bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
version=$1
message=$2

version="v$version"

if [ $# -eq 1 ]; then
git commit -am "Bumped version \`$version\`"
elif [ $# -eq 2 ]; then
git commit -am "Bumped version \`$version\`\n$message"
else
echo "Exactly 1 or 2 argument must be provided"
exit false
fi

git tag "$version"
git push
git push --tags

0 comments on commit f0898d8

Please sign in to comment.