Skip to content

Commit 4fae57d

Browse files
samspade21Brian McFarlane
andauthored
Fix release pipeline: consolidate workflows and fix changelog extraction (#21)
- Fixed critical GITHUB_TOKEN limitation preventing release workflow triggering - Consolidated auto-tag and release workflows into single auto-release.yml - Fixed Python f-string formatting bug in changelog extraction - Removed redundant auto-tag.yml and release.yml workflows - Enhanced error handling and workflow summaries - Maintains v1.3.2 release format standards This resolves the broken release automation that prevented v1.4.1 release creation. Co-authored-by: Brian McFarlane <bmcfarlane@dataminr.com>
1 parent ef33752 commit 4fae57d

File tree

3 files changed

+74
-156
lines changed

3 files changed

+74
-156
lines changed
Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Auto Tag on Main Merge
1+
name: Auto Tag and Release
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
auto-tag:
9+
auto-tag-and-release:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
@@ -99,9 +99,10 @@ jobs:
9999
lines = content.split('\n')
100100
in_version_section = False
101101
changelog_lines = []
102+
version = '${{ steps.get-version.outputs.version }}'
102103
103104
for line in lines:
104-
if line.startswith('## ') and '$VERSION' in line:
105+
if line.startswith('## ') and version in line:
105106
in_version_section = True
106107
continue
107108
elif line.startswith('## ') and in_version_section:
@@ -112,22 +113,30 @@ jobs:
112113
changelog_content = '\n'.join(changelog_lines).strip()
113114
114115
if not changelog_content:
115-
changelog_content = 'Release version $VERSION'
116+
changelog_content = f'Release version {version}'
116117
117118
# Write to file for GitHub Actions
118119
with open('tag_message.txt', 'w') as f:
119-
f.write(f'Release {VERSION}\n\n{changelog_content}')
120+
f.write(f'Release {version}\n\n{changelog_content}')
120121
121-
print(f'Extracted changelog for version $VERSION')
122+
# Also save just changelog content for release
123+
with open('release_notes.txt', 'w') as f:
124+
f.write(changelog_content)
125+
126+
print(f'Extracted changelog for version {version}')
122127
123128
except Exception as e:
124129
print(f'Error extracting changelog: {e}')
125130
# Fallback message
131+
version = '${{ steps.get-version.outputs.version }}'
126132
with open('tag_message.txt', 'w') as f:
127-
f.write(f'Release $VERSION')
133+
f.write(f'Release {version}')
134+
with open('release_notes.txt', 'w') as f:
135+
f.write(f'Release version {version}')
128136
"
129137
130138
- name: Create and push tag
139+
id: create-tag
131140
if: steps.check-release.outputs.is_release == 'true' && steps.check-tag.outputs.tag_exists == 'false'
132141
run: |
133142
TAG_NAME="${{ steps.get-version.outputs.tag }}"
@@ -144,13 +153,46 @@ jobs:
144153
git push origin "$TAG_NAME"
145154
146155
echo "✅ Created and pushed tag: $TAG_NAME"
156+
echo "tag_created=true" >> $GITHUB_OUTPUT
157+
158+
- name: Run HACS validation
159+
if: steps.check-release.outputs.is_release == 'true' && steps.check-tag.outputs.tag_exists == 'false'
160+
uses: hacs/action@main
161+
with:
162+
category: integration
163+
ignore: brands
147164

148-
# Output summary
149-
echo "### 🏷️ Tag Created Successfully!" >> $GITHUB_STEP_SUMMARY
150-
echo "- **Tag:** \`$TAG_NAME\`" >> $GITHUB_STEP_SUMMARY
151-
echo "- **Version:** $VERSION" >> $GITHUB_STEP_SUMMARY
152-
echo "- **Release workflow** will be triggered automatically" >> $GITHUB_STEP_SUMMARY
153-
echo "- **Monitor progress:** [GitHub Actions](https://github.com/${{ github.repository }}/actions)" >> $GITHUB_STEP_SUMMARY
165+
- name: Create release archive
166+
if: steps.check-release.outputs.is_release == 'true' && steps.check-tag.outputs.tag_exists == 'false'
167+
run: |
168+
mkdir -p release/custom_components
169+
cp -r custom_components/vacasa release/custom_components/
170+
cd release
171+
zip -r ../vacasa-${{ steps.get-version.outputs.version }}.zip .
172+
cd ..
173+
174+
- name: Create GitHub Release
175+
if: steps.check-release.outputs.is_release == 'true' && steps.check-tag.outputs.tag_exists == 'false'
176+
uses: ncipollo/release-action@v1
177+
with:
178+
tag: ${{ steps.get-version.outputs.tag }}
179+
name: Release ${{ steps.get-version.outputs.tag }}
180+
bodyFile: release_notes.txt
181+
artifacts: "vacasa-${{ steps.get-version.outputs.version }}.zip"
182+
draft: false
183+
prerelease: false
184+
generateReleaseNotes: true
185+
token: ${{ secrets.GITHUB_TOKEN }}
186+
187+
- name: Summary for successful release
188+
if: steps.check-release.outputs.is_release == 'true' && steps.check-tag.outputs.tag_exists == 'false'
189+
run: |
190+
echo "### 🎉 Release ${{ steps.get-version.outputs.tag }} Created Successfully!" >> $GITHUB_STEP_SUMMARY
191+
echo "- **Tag:** \`${{ steps.get-version.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
192+
echo "- **Version:** ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
193+
echo "- **GitHub Release:** https://github.com/${{ github.repository }}/releases/tag/${{ steps.get-version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
194+
echo "- **HACS Distribution:** Updates will be available shortly" >> $GITHUB_STEP_SUMMARY
195+
echo "- **Download Archive:** vacasa-${{ steps.get-version.outputs.version }}.zip" >> $GITHUB_STEP_SUMMARY
154196
155197
- name: Summary for non-release
156198
if: steps.check-release.outputs.is_release == 'false'
@@ -164,4 +206,4 @@ jobs:
164206
run: |
165207
echo "### ⚠️ Tag Already Exists" >> $GITHUB_STEP_SUMMARY
166208
echo "Tag \`${{ steps.get-version.outputs.tag }}\` already exists." >> $GITHUB_STEP_SUMMARY
167-
echo "No new tag was created." >> $GITHUB_STEP_SUMMARY
209+
echo "No new tag or release was created." >> $GITHUB_STEP_SUMMARY

.github/workflows/release.yml

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

CHANGELOG.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [1.4.1] - 2025-08-19
99

10+
### Fixed
11+
- **Critical Release Pipeline Fix**: Fixed broken release workflow that prevented automatic GitHub releases from being created after tag creation
12+
- **Changelog Extraction Bug**: Corrected Python f-string formatting error in auto-tag workflow that caused "name 'VERSION' is not defined" error
13+
- **Workflow Triggering Issue**: Resolved GITHUB_TOKEN limitation that prevented workflow-to-workflow triggering by consolidating auto-tag and release workflows
14+
1015
### Changed
11-
- **Optimized GitHub Actions Workflows**: Streamlined CI/CD pipeline for 25% faster execution
12-
- Removed redundant `hassfest.yml` workflow - functionality consolidated into main CI workflow
13-
- Restructured CI job dependencies for faster feedback (fast jobs run first, slower validation jobs run after)
14-
- Improved workflow naming for clarity: "Test, Lint & Validate", "Dependency Management & Updates", "Issue & PR Management"
15-
- Coordinated security scanning to eliminate duplication across workflows
16-
- Enhanced job organization with proper dependency chains and parallel execution where beneficial
16+
- **Streamlined Release Process**: Consolidated separate auto-tag and release workflows into single `auto-release.yml` workflow to eliminate cross-workflow triggering issues
17+
- **Enhanced Error Handling**: Improved changelog extraction with proper Python variable substitution and fallback error handling
18+
- **Optimized Workflow Structure**: Reduced from 2 separate workflows to 1 consolidated workflow for more reliable release automation
1719

18-
### Technical Details
19-
- Eliminated duplicate hassfest validation between separate workflow files
20-
- Optimized CI workflow with strategic job dependencies (lint-and-test-fast → validation jobs)
21-
- Consolidated security scanning approach while maintaining comprehensive coverage
22-
- Reduced overall CI runtime and GitHub Actions costs through elimination of redundant operations
20+
### Technical Improvements
21+
- **Single Workflow Architecture**: Auto-tag and release creation now happen in one atomic workflow execution, preventing GitHub security limitations
22+
- **Proper Variable Handling**: Fixed Python f-string usage in changelog extraction to prevent runtime errors
23+
- **Comprehensive Release Creation**: Automated tag creation, HACS validation, release archive generation, and GitHub release publication in one seamless process
24+
- **Maintained Release Quality**: Preserved v1.3.2 release format standards with proper changelog extraction and professional presentation
25+
26+
### Developer Experience
27+
- **Reliable Automation**: Release pipeline now works consistently without manual intervention
28+
- **Clear Error Reporting**: Enhanced workflow summaries provide detailed feedback on release creation process
29+
- **Simplified Maintenance**: Single workflow file reduces complexity and potential points of failure
2330

2431
## [1.4.0] - 2025-08-18
2532

0 commit comments

Comments
 (0)