1+ name : Test Nightly Releases (Dry Run)
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ dry_run :
7+ description : ' Run in dry-run mode (no actual releases)'
8+ required : false
9+ default : true
10+ type : boolean
11+ test_branch :
12+ description : ' Branch to test against'
13+ required : false
14+ default : ' master'
15+ type : string
16+
17+ env :
18+ GO_VERSION : ' 1.24'
19+
20+ jobs :
21+ test-permissions :
22+ name : Test Release Permissions
23+ runs-on : ubuntu-latest
24+ outputs :
25+ authorized : ${{ steps.check.outputs.authorized }}
26+ steps :
27+ - name : Check if user is authorized
28+ id : check
29+ run : |
30+ # Test authorization logic
31+ AUTHORIZED_USERS="leaanthony"
32+
33+ if [[ "$AUTHORIZED_USERS" == *"${{ github.actor }}"* ]]; then
34+ echo "✅ User ${{ github.actor }} is authorized"
35+ echo "authorized=true" >> $GITHUB_OUTPUT
36+ else
37+ echo "❌ User ${{ github.actor }} is not authorized"
38+ echo "authorized=false" >> $GITHUB_OUTPUT
39+ fi
40+
41+ test-changelog-extraction :
42+ name : Test Changelog Extraction
43+ runs-on : ubuntu-latest
44+ needs : test-permissions
45+ if : needs.test-permissions.outputs.authorized == 'true'
46+ steps :
47+ - name : Checkout code
48+ uses : actions/checkout@v4
49+ with :
50+ ref : ${{ github.event.inputs.test_branch }}
51+ fetch-depth : 0
52+
53+ - name : Test v2 changelog extraction
54+ run : |
55+ echo "🧪 Testing v2 changelog extraction..."
56+ CHANGELOG_FILE="website/src/pages/changelog.mdx"
57+
58+ if [ ! -f "$CHANGELOG_FILE" ]; then
59+ echo "❌ v2 changelog file not found"
60+ exit 1
61+ fi
62+
63+ # Extract unreleased section
64+ awk '
65+ /^## \[Unreleased\]/ { found=1; next }
66+ found && /^## / { exit }
67+ found && !/^$/ { print }
68+ ' $CHANGELOG_FILE > v2_release_notes.md
69+
70+ echo "📝 v2 changelog content (first 10 lines):"
71+ head -10 v2_release_notes.md || echo "No content found"
72+ echo "Total lines: $(wc -l < v2_release_notes.md)"
73+
74+ - name : Test v3 changelog extraction (if accessible)
75+ run : |
76+ echo "🧪 Testing v3 changelog extraction..."
77+
78+ if git show v3-alpha:docs/src/content/docs/changelog.mdx > /dev/null 2>&1; then
79+ echo "✅ v3 changelog accessible"
80+
81+ git show v3-alpha:docs/src/content/docs/changelog.mdx | awk '
82+ /^## \[Unreleased\]/ { found=1; next }
83+ found && /^## / { exit }
84+ found && !/^$/ { print }
85+ ' > v3_release_notes.md
86+
87+ echo "📝 v3 changelog content (first 10 lines):"
88+ head -10 v3_release_notes.md || echo "No content found"
89+ echo "Total lines: $(wc -l < v3_release_notes.md)"
90+ else
91+ echo "⚠️ v3 changelog not accessible from current context"
92+ fi
93+
94+ test-version-detection :
95+ name : Test Version Detection
96+ runs-on : ubuntu-latest
97+ needs : test-permissions
98+ if : needs.test-permissions.outputs.authorized == 'true'
99+ outputs :
100+ v2_current_version : ${{ steps.versions.outputs.v2_current }}
101+ v2_next_patch : ${{ steps.versions.outputs.v2_next_patch }}
102+ v2_next_minor : ${{ steps.versions.outputs.v2_next_minor }}
103+ v2_next_major : ${{ steps.versions.outputs.v2_next_major }}
104+ steps :
105+ - name : Checkout code
106+ uses : actions/checkout@v4
107+ with :
108+ fetch-depth : 0
109+
110+ - name : Test version detection logic
111+ id : versions
112+ run : |
113+ echo "🧪 Testing version detection..."
114+
115+ # Test v2 version parsing
116+ if [ -f "v2/cmd/wails/internal/version.txt" ]; then
117+ CURRENT_V2=$(cat v2/cmd/wails/internal/version.txt | sed 's/^v//')
118+ echo "Current v2 version: v$CURRENT_V2"
119+ echo "v2_current=v$CURRENT_V2" >> $GITHUB_OUTPUT
120+
121+ # Parse and increment
122+ IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_V2"
123+ MAJOR=${VERSION_PARTS[0]}
124+ MINOR=${VERSION_PARTS[1]}
125+ PATCH=${VERSION_PARTS[2]}
126+
127+ PATCH_VERSION="v$MAJOR.$MINOR.$((PATCH + 1))"
128+ MINOR_VERSION="v$MAJOR.$((MINOR + 1)).0"
129+ MAJOR_VERSION="v$((MAJOR + 1)).0.0"
130+
131+ echo "v2_next_patch=$PATCH_VERSION" >> $GITHUB_OUTPUT
132+ echo "v2_next_minor=$MINOR_VERSION" >> $GITHUB_OUTPUT
133+ echo "v2_next_major=$MAJOR_VERSION" >> $GITHUB_OUTPUT
134+
135+ echo "✅ Patch: v$CURRENT_V2 → $PATCH_VERSION"
136+ echo "✅ Minor: v$CURRENT_V2 → $MINOR_VERSION"
137+ echo "✅ Major: v$CURRENT_V2 → $MAJOR_VERSION"
138+ else
139+ echo "❌ v2 version file not found"
140+ fi
141+
142+ test-commit-analysis :
143+ name : Test Commit Analysis
144+ runs-on : ubuntu-latest
145+ needs : test-permissions
146+ if : needs.test-permissions.outputs.authorized == 'true'
147+ steps :
148+ - name : Checkout code
149+ uses : actions/checkout@v4
150+ with :
151+ fetch-depth : 0
152+
153+ - name : Test commit analysis
154+ run : |
155+ echo "🧪 Testing commit analysis..."
156+
157+ # Get recent commits for testing
158+ echo "Recent commits:"
159+ git log --oneline -10
160+
161+ # Test conventional commit detection
162+ RECENT_COMMITS=$(git log --oneline --since="7 days ago")
163+ echo "Commits from last 7 days:"
164+ echo "$RECENT_COMMITS"
165+
166+ # Analyze for release type
167+ RELEASE_TYPE="patch"
168+ if echo "$RECENT_COMMITS" | grep -q "feat!\|fix!\|BREAKING CHANGE:"; then
169+ RELEASE_TYPE="major"
170+ elif echo "$RECENT_COMMITS" | grep -q "feat\|BREAKING CHANGE"; then
171+ RELEASE_TYPE="minor"
172+ fi
173+
174+ echo "✅ Detected release type: $RELEASE_TYPE"
175+
176+ test-summary :
177+ name : Test Summary
178+ runs-on : ubuntu-latest
179+ needs : [test-permissions, test-changelog-extraction, test-version-detection, test-commit-analysis]
180+ if : always()
181+ steps :
182+ - name : Print test results
183+ run : |
184+ echo "# 🧪 Nightly Release Workflow Test Results" >> $GITHUB_STEP_SUMMARY
185+ echo "" >> $GITHUB_STEP_SUMMARY
186+
187+ if [ "${{ needs.test-permissions.result }}" == "success" ]; then
188+ echo "✅ **Permissions Test**: Passed" >> $GITHUB_STEP_SUMMARY
189+ else
190+ echo "❌ **Permissions Test**: Failed" >> $GITHUB_STEP_SUMMARY
191+ fi
192+
193+ if [ "${{ needs.test-changelog-extraction.result }}" == "success" ]; then
194+ echo "✅ **Changelog Extraction**: Passed" >> $GITHUB_STEP_SUMMARY
195+ else
196+ echo "❌ **Changelog Extraction**: Failed" >> $GITHUB_STEP_SUMMARY
197+ fi
198+
199+ if [ "${{ needs.test-version-detection.result }}" == "success" ]; then
200+ echo "✅ **Version Detection**: Passed" >> $GITHUB_STEP_SUMMARY
201+ echo " - Current v2: ${{ needs.test-version-detection.outputs.v2_current_version }}" >> $GITHUB_STEP_SUMMARY
202+ echo " - Next patch: ${{ needs.test-version-detection.outputs.v2_next_patch }}" >> $GITHUB_STEP_SUMMARY
203+ echo " - Next minor: ${{ needs.test-version-detection.outputs.v2_next_minor }}" >> $GITHUB_STEP_SUMMARY
204+ echo " - Next major: ${{ needs.test-version-detection.outputs.v2_next_major }}" >> $GITHUB_STEP_SUMMARY
205+ else
206+ echo "❌ **Version Detection**: Failed" >> $GITHUB_STEP_SUMMARY
207+ fi
208+
209+ if [ "${{ needs.test-commit-analysis.result }}" == "success" ]; then
210+ echo "✅ **Commit Analysis**: Passed" >> $GITHUB_STEP_SUMMARY
211+ else
212+ echo "❌ **Commit Analysis**: Failed" >> $GITHUB_STEP_SUMMARY
213+ fi
214+
215+ echo "" >> $GITHUB_STEP_SUMMARY
216+ echo "**Note**: This was a dry-run test. No actual releases were created." >> $GITHUB_STEP_SUMMARY
0 commit comments