Skip to content

Commit c65f7ff

Browse files
committed
bug fixes for new features
1 parent 52b2420 commit c65f7ff

24 files changed

+1802
-247
lines changed

.github/scripts/generate_release_version.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import datetime
44
import argparse
55
import subprocess
6+
import sys
67

78
def get_current_date_version():
89
"""Returns the current date in Year.Month format (e.g., 2025.12)."""
@@ -70,9 +71,21 @@ def main():
7071
help="Type of release (stable, prerelease, development)")
7172
args = parser.parse_args()
7273

73-
base_ver = get_current_date_version()
74-
tags = get_existing_tags()
75-
next_version = calculate_next_version(base_ver, tags, args.release_type)
74+
# Fallback version if version generation fails
75+
FALLBACK_VERSION = "2026.1.2"
76+
77+
try:
78+
base_ver = get_current_date_version()
79+
tags = get_existing_tags()
80+
next_version = calculate_next_version(base_ver, tags, args.release_type)
81+
82+
# Validate version format
83+
if not next_version or not re.match(r'^\d+\.\d+\.\d+', next_version):
84+
print(f"Warning: Generated version '{next_version}' is invalid, using fallback: {FALLBACK_VERSION}", file=sys.stderr)
85+
next_version = FALLBACK_VERSION
86+
except Exception as e:
87+
print(f"Error generating version: {e}, using fallback: {FALLBACK_VERSION}", file=sys.stderr)
88+
next_version = FALLBACK_VERSION
7689

7790
print(next_version)
7891

.github/workflows/release.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ jobs:
3838

3939
- name: Generate Version
4040
id: version
41-
run: python .github/scripts/generate_release_version.py --type ${{ github.event.inputs.release_type }}
41+
run: |
42+
VERSION=$(python .github/scripts/generate_release_version.py --type ${{ github.event.inputs.release_type }})
43+
# Fallback to 2026.1.2 if version generation fails or returns invalid version
44+
if [ -z "$VERSION" ] || [ "$VERSION" = "0.0.0" ] || ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+'; then
45+
echo "Warning: Version generation failed or returned invalid version '$VERSION', using fallback: 2026.1.2"
46+
VERSION="2026.1.2"
47+
fi
48+
echo "version=$VERSION" >> $GITHUB_OUTPUT
49+
echo "is_prerelease=${{ github.event.inputs.release_type != 'stable' }}" >> $GITHUB_OUTPUT
50+
echo "Generated version: $VERSION"
4251
4352
- name: Update Version in Files
4453
run: |
@@ -139,8 +148,11 @@ jobs:
139148
PATCH=$(echo $VERSION | cut -d. -f3)
140149
NEXT_PATCH=$((PATCH + 1))
141150
DEV_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}-dev"
151+
# Use release version as fallback (without -dev suffix)
152+
FALLBACK_VERSION="${MAJOR}.${MINOR}.${PATCH}"
142153
143154
echo "Setting development version to $DEV_VERSION"
155+
echo "Updating fallback versions to $FALLBACK_VERSION"
144156
145157
# Update version files
146158
sed -i "s/version = \".*\"/version = \"$DEV_VERSION\"/" pyproject.toml
@@ -154,9 +166,17 @@ jobs:
154166
sed -i "s/#define MyAppVersion \".*\"/#define MyAppVersion \"$BASE_VERSION\"/" switchcraft_legacy.iss
155167
sed -i "s/#define MyAppVersionNumeric \".*\"/#define MyAppVersionNumeric \"$BASE_VERSION\"/" switchcraft_legacy.iss
156168
169+
# Update fallback versions in build scripts and version generator
170+
# Update build_release.ps1 fallback
171+
sed -i "s/\$AppVersion = \".*\"/\$AppVersion = \"$FALLBACK_VERSION\"/" scripts/build_release.ps1
172+
sed -i "s/\$AppVersionNumeric = \".*\"/\$AppVersionNumeric = \"$FALLBACK_VERSION\"/" scripts/build_release.ps1
173+
174+
# Update generate_release_version.py fallback
175+
sed -i "s/FALLBACK_VERSION = \".*\"/FALLBACK_VERSION = \"$FALLBACK_VERSION\"/" .github/scripts/generate_release_version.py
176+
157177
# Commit
158-
git add pyproject.toml src/switchcraft/__init__.py file_version_info.txt switchcraft_modern.iss switchcraft_legacy.iss
159-
git commit -m "chore: bump version to $DEV_VERSION for development [skip ci]"
178+
git add pyproject.toml src/switchcraft/__init__.py file_version_info.txt switchcraft_modern.iss switchcraft_legacy.iss scripts/build_release.ps1 .github/scripts/generate_release_version.py
179+
git commit -m "chore: bump version to $DEV_VERSION and update fallback versions to $FALLBACK_VERSION [skip ci]"
160180
git push origin main
161181
162182
build:

data/stacks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

docs/INTUNE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Pro-Users can enable the **"All-in-One"** button in the Analyzer result pane to
1515
## ⚙️ Configuration & Settings
1616

1717
SwitchCraft supports extensive configuration via the GUI or Registry/GPO for enterprise environments.
18+
w
19+
> [!IMPORTANT]
20+
> **Intune OMA-URI Configuration**: For detailed instructions on configuring Intune Custom Profiles (OMA-URI), please refer to the **[Intune Configuration Guide](Intune_Configuration_Guide.md)**.
21+
> **Critical**: Ensure you use the **String (XML)** Data Type for all ADMX-backed policies.
1822
1923
### Intune API Access
2024
To enable direct uploads, you must register an App in Azure AD (Entra ID) and provide the credentials in Settings:

docs/IntuneConfig.md

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)