@@ -109,15 +109,57 @@ jobs:
109109 path : dist/alfred-setapp-search.alfredworkflow
110110 if-no-files-found : error
111111
112- - name : Generate unique tag for stable release
112+ - name : Read workflow version for stable release
113113 if : github.ref == 'refs/heads/main'
114114 id : stable_tag
115115 run : |
116- TIMESTAMP=$(date +%Y%m%d-%H%M%S)
117- TAG="v${{ github.run_number }}-${TIMESTAMP}"
116+ VERSION=$(python - <<'PY'
117+ import plistlib
118+ with open('src/info.plist', 'rb') as f:
119+ data = plistlib.load(f)
120+ print(data.get('version', '').strip())
121+ PY
122+ )
123+ if [ -z "$VERSION" ]; then
124+ echo "Could not read version from src/info.plist"
125+ exit 1
126+ fi
127+ TAG="v${VERSION}"
118128 echo "tag=${TAG}" >> $GITHUB_OUTPUT
129+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
119130 echo "Generated stable tag: ${TAG}"
120131
132+ - name : Build stable release notes from README
133+ if : github.ref == 'refs/heads/main'
134+ id : stable_notes
135+ run : |
136+ VERSION="${{ steps.stable_tag.outputs.version }}"
137+ NOTES_FILE="release-notes.md"
138+
139+ {
140+ echo "## Alfred SetApp Search Workflow - Release v${VERSION}"
141+ echo
142+ echo "### Changes"
143+ awk -v ver="$VERSION" '
144+ $0 ~ "^### v" ver "$" { in_section=1; next }
145+ in_section && $0 ~ /^### v/ { exit }
146+ in_section && $0 ~ /^- / { print }
147+ ' README.md
148+ echo
149+ echo "### Installation"
150+ echo "1. Download the \`alfred-setapp-search.alfredworkflow\` file"
151+ echo "2. Double-click to install in Alfred"
152+ echo "3. Configure the keyword (default: \`seta\`)"
153+ } > "$NOTES_FILE"
154+
155+ if ! grep -q "^- " "$NOTES_FILE"; then
156+ echo "- Release generated from commit ${{ github.sha }}" >> "$NOTES_FILE"
157+ fi
158+
159+ {
160+ echo "notes_path=${NOTES_FILE}"
161+ } >> $GITHUB_OUTPUT
162+
121163 - name : Generate unique tag for beta release
122164 if : github.ref == 'refs/heads/dev'
123165 id : beta_tag
@@ -138,24 +180,7 @@ jobs:
138180 make_latest : true
139181 files : |
140182 dist/alfred-setapp-search.alfredworkflow
141- body : |
142- ## Alfred SetApp Search Workflow - Release ${{ steps.stable_tag.outputs.tag }}
143-
144- ### Changes
145- - Built from commit ${{ github.sha }}
146- - Automated build and test passed
147- - **Stable Release** from main branch
148-
149- ### Installation
150- 1. Download the `alfred-setapp-search.alfredworkflow` file
151- 2. Double-click to install in Alfred
152- 3. Configure the keyword (default: `seta`)
153-
154- ### Features
155- - Search 260+ SetApp applications
156- - View app ratings and platforms
157- - Open SetApp pages or launch apps directly
158- - Cached app icons and data
183+ body_path : ${{ steps.stable_notes.outputs.notes_path }}
159184 env :
160185 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
161186
0 commit comments