-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump minor version script * create tag empty script * get_version script * use get_version script * create tag script * deploy yml update * Fixing other scripts * print version --------- Co-authored-by: Maksym Bilan <>
- Loading branch information
1 parent
51e196f
commit 75d59ee
Showing
7 changed files
with
148 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,34 @@ | ||
name: Bump Minor Version | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
setup-telegram-bot: | ||
name: Bump Minor Version | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run script file | ||
run: | | ||
chmod +x ./scripts/get_version.sh | ||
chmod +x ./scripts/bump_version.sh | ||
./scripts/bump_version.sh --minor | ||
shell: bash | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
branch: 'bump-minor-version' | ||
delete-branch: true | ||
commit-message: 'Bump minor version' | ||
title: 'Bump minor version' | ||
token: ${{ secrets.GITHUB_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
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,25 @@ | ||
#!/bin/bash | ||
|
||
# Get the directory of this script | ||
SCRIPT_DIR=$(dirname "$0") | ||
|
||
# Path to the version.go file (adjusted for the relative path) | ||
VERSION_FILE="$SCRIPT_DIR/../version.go" | ||
|
||
# Check if version.go exists | ||
if [[ ! -f "$VERSION_FILE" ]]; then | ||
echo "Error: $VERSION_FILE not found." | ||
exit 1 | ||
fi | ||
|
||
# Path to get_version.sh | ||
GET_VERSION_SCRIPT="$SCRIPT_DIR/get_version.sh" | ||
|
||
# Import the current version using the get_version.sh script | ||
CURRENT_VERSION=$("$GET_VERSION_SCRIPT") | ||
|
||
# Create a new tag | ||
git tag -a "releases/$CURRENT_VERSION" -m "$CURRENT_VERSION" | ||
|
||
# Push the tag to the remote repository | ||
git push origin "releases/$CURRENT_VERSION" |
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,24 @@ | ||
#!/bin/bash | ||
|
||
# File containing the version constant (relative to the script location) | ||
VERSION_FILE="./version.go" | ||
|
||
# Pattern to match the version line | ||
VERSION_PATTERN='const AppVersion = "' | ||
|
||
# Check if version.go exists | ||
if [[ ! -f "$VERSION_FILE" ]]; then | ||
echo "Error: $VERSION_FILE not found." | ||
exit 1 | ||
fi | ||
|
||
# Extract the current version | ||
CURRENT_VERSION=$(grep "$VERSION_PATTERN" "$VERSION_FILE" | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/') | ||
|
||
if [[ -z "$CURRENT_VERSION" ]]; then | ||
echo "Error: Could not find the current version in $VERSION_FILE" | ||
exit 1 | ||
fi | ||
|
||
# Output the current version | ||
echo "$CURRENT_VERSION" |