Skip to content

Commit

Permalink
fbs annoyingly does not allow non-numerical chars in version name
Browse files Browse the repository at this point in the history
  • Loading branch information
apastel committed May 12, 2024
1 parent 8e894a5 commit 2a9d509
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,3 @@ jobs:
needs: create-tag
uses: ./.github/workflows/release.yml
secrets: inherit
roll-to-snapshot:
needs: release-and-publish
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Roll to next snapshot version
run: |
pdm version snapshot
- name: Commit version files to main
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Roll to next snapshot version
18 changes: 6 additions & 12 deletions bump_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Validate argument
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <major|minor|patch|snapshot|custom_version>"
echo "Usage: $0 <major|minor|patch|custom_version>"
exit 1
fi

if [[ "$1" != "major" && "$1" != "minor" && "$1" != "patch" && "$1" != "snapshot" ]]; then
if [[ "$1" != "major" && "$1" != "minor" && "$1" != "patch" ]]; then
echo "Custom version supplied: '$1'"
fi

Expand All @@ -27,21 +27,18 @@ bump_version_py() {
minor=$(echo "$current_version" | cut -d. -f2)
patch=$(echo "$current_version" | cut -d. -f3)

if [[ "$version_part" != "major" && "$version_part" != "minor" && "$version_part" != "patch" && "$version_part" != "snapshot" ]]; then
if [[ "$version_part" != "major" && "$version_part" != "minor" && "$version_part" != "patch" ]]; then
new_version="$version_part"
else
# Bump the specified version part
case "$version_part" in
major) major=$((major + 1)); minor=0; patch=0;;
minor) minor=$((minor + 1)); patch=0;;
patch|snapshot) patch=$((patch + 1));;
patch) patch=$((patch + 1));;
esac

# Create new version string
new_version="${major}.${minor}.${patch}"
if [[ $version_part == "snapshot" ]]; then
new_version+="-SNAPSHOT"
fi
fi

# Replace old version with new version in the file
Expand All @@ -63,21 +60,18 @@ bump_version_json() {
minor=$(echo "$current_version" | cut -d. -f2)
patch=$(echo "$current_version" | cut -d. -f3)

if [[ "$version_part" != "major" && "$version_part" != "minor" && "$version_part" != "patch" && "$version_part" != "snapshot" ]]; then
if [[ "$version_part" != "major" && "$version_part" != "minor" && "$version_part" != "patch" ]]; then
new_version="$version_part"
else
# Bump the specified version part
case "$version_part" in
major) major=$((major + 1)); minor=0; patch=0;;
minor) minor=$((minor + 1)); patch=0;;
patch|snapshot) patch=$((patch + 1));;
patch) patch=$((patch + 1));;
esac

# Create new version string
new_version="${major}.${minor}.${patch}"
if [[ $version_part == "snapshot" ]]; then
new_version+="-SNAPSHOT"
fi
fi

# Replace old version with new version in a temporary string
Expand Down
2 changes: 1 addition & 1 deletion gui/src/build/settings/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"app_name": "YTMusic_Deleter",
"author": "Alex Pastel",
"main_module": "src/main/python/main.py",
"version": "2.3.2",
"version": "2.3.0",
"sentry_dsn": "https://8cecdde1e7344deda25e39924c01a73c@o1393803.ingest.sentry.io/6715501",
"public_settings": [
"app_name",
Expand Down
2 changes: 1 addition & 1 deletion ytmusic_deleter/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.3.2"
__version__ = "2.3.0"

0 comments on commit 2a9d509

Please sign in to comment.