@@ -27,18 +27,16 @@ jobs:
27
27
- name : Remove optional "v" prefix
28
28
id : version
29
29
run : |
30
- VERSION=${{ inputs.version }}
31
30
echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
31
+ env :
32
+ VERSION : ${{ inputs.version }}
32
33
33
34
- name : Check if branch and version match
34
35
id : guard
35
36
run : |
36
37
MAJOR_VERSION="${NUMERIC_VERSION%%.*}"
37
38
BRANCH_MAJOR_VERSION="${BRANCH%%.*}"
38
39
39
- echo "MAJOR_VERSION=$(echo $MAJOR_VERSION)" >> $GITHUB_OUTPUT;
40
- echo "BRANCH_MAJOR_VERSION=$(echo $BRANCH_MAJOR_VERSION)" >> $GITHUB_OUTPUT;
41
-
42
40
if [ "$MAJOR_VERSION" != "$BRANCH_MAJOR_VERSION" ]; then
43
41
echo "Mismatched versions! Aborting."
44
42
VERSION_MISMATCH='true';
47
45
VERSION_MISMATCH='false';
48
46
fi
49
47
50
- echo "VERSION_MISMATCH=$(echo $VERSION_MISMATCH)" >> $GITHUB_OUTPUT;
48
+ echo "VERSION_MISMATCH=$(echo $VERSION_MISMATCH)" >> " $GITHUB_OUTPUT" ;
51
49
env :
52
50
BRANCH : ${{ github.ref_name }}
53
51
NUMERIC_VERSION : ${{ steps.version.outputs.version }}
@@ -67,53 +65,74 @@ jobs:
67
65
with :
68
66
commit_message : " Update version to v${{ steps.version.outputs.version }}"
69
67
70
- - name : SSH into splitter server
71
- uses : appleboy/ssh-action@master
68
+ # - name: SSH into splitter server
69
+ # uses: appleboy/ssh-action@master
70
+ # with:
71
+ # host: 104.248.56.26
72
+ # username: forge
73
+ # key: ${{ secrets.SSH_PRIVATE_KEY_SPLITTER }}
74
+ # script: |
75
+ # cd laravel-${{ github.ref_name }}
76
+ # git pull origin ${{ github.ref_name }}
77
+ # bash ./bin/release.sh v${{ steps.version.outputs.version }}
78
+ # script_stop: true
79
+
80
+ - name : Generate release notes
81
+ id : generated-notes
82
+ uses : RedCrafter07/release-notes-action@main
72
83
with :
73
- host : 104.248.56.26
74
- username : forge
75
- key : ${{ secrets.SSH_PRIVATE_KEY_SPLITTER }}
76
- script : |
77
- cd laravel-${{ github.ref_name }}
78
- git pull origin ${{ github.ref_name }}
79
- bash ./bin/release.sh v${{ steps.version.outputs.version }}
80
- script_stop : true
81
-
82
- # - name: Generate release notes
83
- # id: generated-notes
84
- # uses: RedCrafter07/release-notes-action@main
85
- # with:
86
- # tag-name: v${{ steps.version.outputs.version }}
87
- # token: ${{ secrets.GITHUB_TOKEN }}
88
- # branch: ${{ github.ref_name }}
89
-
90
- # - name: Cleanup release notes
91
- # id: cleaned-notes
92
- # run: |
93
- # RELEASE_NOTES=$(echo $RELEASE_NOTES | sed '/## What/d')
94
- # RELEASE_NOTES=$(echo $RELEASE_NOTES | sed '/## New Contributors/,$d')
95
- # echo "notes=${RELEASE_NOTES}" >> "$GITHUB_OUTPUT"
96
- # env:
97
- # RELEASE_NOTES: ${{ steps.generated-notes.outputs.release-notes }}
98
-
99
- # - name: Create release
100
- # uses: softprops/action-gh-release@v2
101
- # env:
102
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103
- # with:
104
- # tag_name: v${{ steps.version.outputs.version }}
105
- # name: v${{ steps.version.outputs.version }}
106
- # body: ${{ steps.cleaned-notes.outputs.notes }}
107
- # target_commitish: ${{ github.ref_name }}
108
- # make_latest: 'legacy'
109
-
110
- # update-changelog:
111
- # needs: release
112
-
113
- # name: Update changelog
114
-
115
- # uses: laravel/.github/.github/workflows/update-changelog.yml@main
116
- # with:
117
- # branch: ${{ github.ref_name }}
118
- # version: "v${{ needs.release.outputs.version }}"
119
- # notes: ${{ needs.release.outputs.notes }}
84
+ tag-name : v${{ steps.version.outputs.version }}
85
+ token : ${{ secrets.GITHUB_TOKEN }}
86
+ branch : ${{ github.ref_name }}
87
+
88
+ - name : Cleanup release notes
89
+ id : cleaned-notes
90
+ run : |
91
+ START_FROM=$(echo -n "$RELEASE_NOTES" | awk "/What's Changed/{ print NR; exit }" -)
92
+ DROP_FROM_CONTRIBUTORS=$(echo -n "$RELEASE_NOTES" | awk "/New Contributors/{ print NR; exit }" -)
93
+ DROP_FROM_FULL_CHANGELOG=$(echo -n "$RELEASE_NOTES" | awk "/Full Changelog/{ print NR; exit }" -)
94
+
95
+ # Drop everything starting from "Full Changelog"
96
+ if [ ! -z "$DROP_FROM_FULL_CHANGELOG" ]; then
97
+ RELEASE_NOTES=$(echo -n "$RELEASE_NOTES" | sed "${DROP_FROM_FULL_CHANGELOG},$ d")
98
+ fi
99
+
100
+ # Drop everything starting from "New Contributors"
101
+ if [ ! -z "$DROP_FROM_CONTRIBUTORS" ]; then
102
+ RELEASE_NOTES=$(echo -n "$RELEASE_NOTES" | sed "${DROP_FROM_CONTRIBUTORS},$ d")
103
+ fi
104
+
105
+ # Drop the line "What's Changed"
106
+ if [ ! -z "$START_FROM" ]; then
107
+ RELEASE_NOTES=$(echo -n "$RELEASE_NOTES" | sed "${START_FROM}d")
108
+ fi
109
+
110
+ {
111
+ echo 'notes<<EOF'
112
+ echo "$RELEASE_NOTES"
113
+ echo EOF
114
+ } >> "$GITHUB_OUTPUT";
115
+ env :
116
+ RELEASE_NOTES : ${{ steps.generated-notes.outputs.release-notes }}
117
+
118
+ - name : Create release
119
+ uses : softprops/action-gh-release@v2
120
+ env :
121
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122
+ with :
123
+ tag_name : v${{ steps.version.outputs.version }}
124
+ name : v${{ steps.version.outputs.version }}
125
+ body : ${{ steps.cleaned-notes.outputs.notes }}
126
+ target_commitish : ${{ github.ref_name }}
127
+ make_latest : " ${{ github.ref_name == github.event.repository.default_branch }}"
128
+
129
+ update-changelog :
130
+ needs : release
131
+
132
+ name : Update changelog
133
+
134
+ uses : laravel/.github/.github/workflows/update-changelog.yml@main
135
+ with :
136
+ branch : ${{ github.ref_name }}
137
+ version : " v${{ needs.release.outputs.version }}"
138
+ notes : ${{ needs.release.outputs.notes }}
0 commit comments