File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 3434 run : |
3535 ./build.sh build
3636
37- - run : |
38- set -x
39- tag_name="${GITHUB_REF##*/}"
40- gh release create "$tag_name" build/*
37+ - name : Generate changelog
38+ id : changelog
39+ run : |
40+ # Get the previous tag (if any)
41+ previous_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
42+ if [ -n "$previous_tag" ]; then
43+ log=$(git log --pretty=format:"- %s" "$previous_tag"..HEAD)
44+ else
45+ log=$(git log --pretty=format:"- %s")
46+ fi
47+ echo "changelog<<EOF" >> $GITHUB_OUTPUT
48+ echo "$log" >> $GITHUB_OUTPUT
49+ echo "EOF" >> $GITHUB_OUTPUT
50+
51+ - name : Create GitHub Release (draft)
52+ uses : softprops/action-gh-release@v1
53+ with :
54+ files : build/*
55+ tag_name : ${{ github.ref_name }}
56+ name : ${{ github.ref_name }}
57+ body : ${{ steps.changelog.outputs.changelog }}
58+ draft : true
4159 env :
4260 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments