Skip to content

Commit c6e767a

Browse files
Automatically create draft release on tag
This patch makes the publish step automatically create a draft release when the tag is pushed containing the latest information from the changelog.
1 parent 04e2188 commit c6e767a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,22 @@ jobs:
3838
needs: [build]
3939
if: success() && startsWith(github.ref, 'refs/tags/')
4040
steps:
41+
- uses: actions/checkout@v4
4142
- uses: actions/download-artifact@v4
42-
- run: npx vsce publish --packagePath $(find tarantool-vscode* -iname "*.vsix")
43+
- name: Publish
44+
run: npx vsce publish --packagePath $(find tarantool-vscode* -iname "*.vsix")
4345
env:
4446
VSCE_PAT: ${{ secrets.VSCE_PAT }}
47+
- id: release_vars
48+
run: |
49+
CHGLOG=CHANGELOG.md;
50+
X=$(grep -n "^## \[[0-9]" $CHGLOG | cut -f1 -d: | head -1);
51+
Y=$(grep -n "^## \[[0-9]" $CHGLOG | cut -f1 -d: | head -2 | tail -1);
52+
awk -v x=$X -v y=$Y 'NR > x && NR < y' $CHGLOG > changelog-latest.md;
53+
echo "artifact=$(find tarantool-vscode* -iname '*.vsix' | xargs)" >> "$GITHUB_OUTPUT"
54+
- name: Draft release
55+
uses: softprops/action-gh-release@v2
56+
with:
57+
body_path: changelog-latest.md
58+
draft: true
59+
files: ${{ steps.release_vars.outputs.artifact }}

0 commit comments

Comments
 (0)