@@ -3,13 +3,13 @@ name: Release
33on :
44 push :
55 tags :
6- - ' v*'
6+ - ' v*.*.* '
77
88permissions :
99 contents : write
1010
1111jobs :
12- create_release :
12+ create-release :
1313 name : Create Release
1414 runs-on : ubuntu-latest
1515
@@ -19,51 +19,57 @@ jobs:
1919 with :
2020 fetch-depth : 0
2121
22- - name : Get Tag Name
23- id : tag
24- run : echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
22+ - name : Set Up Flutter
23+ uses : subosito/flutter-action@v2
24+ with :
25+ channel : stable
26+ cache : true
2527
26- - name : Get Previous Tag
27- id : prev_tag
28+ - name : Install Melos
2829 run : |
29- PREV_TAG=$(git describe --tags --abbrev=0 ${{ steps.tag.outputs.tag }}^ 2>/dev/null || echo "")
30- echo "prev_tag=${PREV_TAG}" >> $GITHUB_OUTPUT
30+ flutter pub global activate melos
31+ echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
32+
33+ - name : Bootstrap Workspace
34+ run : melos bootstrap
35+
36+ - name : Run Tests
37+ run : melos test
38+
39+ - name : Run Analysis
40+ run : melos analyze
3141
3242 - name : Generate Changelog
3343 id : changelog
3444 run : |
35- if [ -z "${{ steps.prev_tag.outputs.prev_tag }}" ]; then
36- CHANGELOG=$(git log --pretty=format:"- %s (%h)" ${{ steps.tag.outputs.tag }})
45+ # Get previous tag
46+ PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
47+
48+ if [ -z "$PREV_TAG" ]; then
49+ # First release, get all commits
50+ COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
3751 else
38- CHANGELOG=$(git log --pretty=format:"- %s (%h)" ${{ steps.prev_tag.outputs.prev_tag }}..${{ steps.tag.outputs.tag }})
52+ # Get commits since previous tag
53+ COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
3954 fi
40- echo "changelog<<EOF" >> $GITHUB_OUTPUT
41- echo "$CHANGELOG" >> $GITHUB_OUTPUT
42- echo "EOF" >> $GITHUB_OUTPUT
55+
56+ # Save to file for multiline output
57+ echo "$COMMITS" > changelog.txt
58+
59+ # Set output
60+ echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT
4361
4462 - name : Create Release
45- uses : softprops/action-gh-release@v2
63+ uses : softprops/action-gh-release@v1
4664 with :
47- tag_name : ${{ steps.tag.outputs.tag }}
48- name : Release ${{ steps.tag.outputs.tag }}
49- body : |
50- ## Changes in ${{ steps.tag.outputs.tag }}
51-
52- ${{ steps.changelog.outputs.changelog }}
53-
54- ## Installation
55-
56- Add this to your package's `pubspec.yaml` file:
57-
58- ```yaml
59- dependencies:
60- local_storage_cache: ${{ steps.tag.outputs.tag }}
61- ```
62-
63- ## Full Changelog
64-
65- See [CHANGELOG.md](https://github.com/protheeuz/local-storage-cache/blob/${{ steps.tag.outputs.tag }}/packages/local_storage_cache/CHANGELOG.md) for detailed changes.
65+ body_path : changelog.txt
6666 draft : false
67- prerelease : ${{ contains(steps.tag.outputs.tag, '-') }}
67+ prerelease : false
68+ generate_release_notes : true
6869 env :
6970 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
71+
72+ - name : Notify Success
73+ run : |
74+ echo "✅ Release ${{ github.ref_name }} created successfully!"
75+ echo "📦 View release at: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
0 commit comments