Skip to content

Commit 37189cd

Browse files
committed
fix(release): Simplify shell script format
1 parent 89a6f04 commit 37189cd

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,57 +71,38 @@ jobs:
7171
if: steps.changelog_check.outputs.changelog_exists == 'false'
7272
run: |
7373
VERSION="${{ steps.version.outputs.version }}"
74-
75-
# Generate changelog
76-
git-cliff --config cliff.toml --tag "v${VERSION}" --verbose > CHANGELOG.md
74+
git-cliff --config cliff.toml --tag "v$VERSION" --verbose > CHANGELOG.md
7775
7876
- name: Format generated changelog
7977
if: steps.changelog_check.outputs.changelog_exists == 'false'
8078
run: |
8179
VERSION="${{ steps.version.outputs.version }}"
82-
83-
# Add version header to generated changelog
8480
echo "# Changelog - Version $VERSION" > CHANGELOG_temp.md
8581
echo "" >> CHANGELOG_temp.md
8682
echo "*This changelog was automatically generated using git-cliff*" >> CHANGELOG_temp.md
8783
echo "" >> CHANGELOG_temp.md
88-
89-
# Append generated changelog
9084
cat CHANGELOG.md >> CHANGELOG_temp.md
91-
92-
# Replace temp file
9385
mv CHANGELOG_temp.md CHANGELOG.md
94-
95-
# Create versioned changelog
9686
cp CHANGELOG.md "CHANGELOG_${VERSION}.md"
9787
9888
- name: Create release notes
9989
id: release_notes
10090
run: |
10191
VERSION="${{ steps.version.outputs.version }}"
102-
10392
if [ "${{ steps.changelog_check.outputs.changelog_exists }}" = "true" ]; then
10493
CHANGELOG_FILE="CHANGELOG_${VERSION}.md"
105-
106-
# Use existing changelog
10794
echo "### Release $VERSION" > release_notes.md
10895
echo "" >> release_notes.md
10996
echo "*Using existing \`$CHANGELOG_FILE\`*" >> release_notes.md
11097
echo "" >> release_notes.md
111-
112-
# Add changelog content
11398
cat "$CHANGELOG_FILE" >> release_notes.md
11499
else
115-
# Use git-cliff generated changelog
116100
echo "### Release $VERSION" > release_notes.md
117101
echo "" >> release_notes.md
118102
echo "*Automatically generated using git-cliff*" >> release_notes.md
119103
echo "" >> release_notes.md
120-
121-
# Append generated changelog (without header we added)
122104
tail -n +2 CHANGELOG.md >> release_notes.md
123105
fi
124-
125106
echo "notes_file=release_notes.md" >> $GITHUB_OUTPUT
126107
127108
- name: Create GitHub Release
@@ -130,12 +111,7 @@ jobs:
130111
run: |
131112
VERSION="${{ steps.version.outputs.version }}"
132113
NOTES_FILE="${{ steps.release_notes.outputs.notes_file }}"
133-
134-
# Create release using GitHub CLI
135-
gh release create "v${VERSION}" \
136-
--title "v${VERSION}" \
137-
--notes-file "$NOTES_FILE" \
138-
--repo "$GITHUB_REPOSITORY"
114+
gh release create "v$VERSION" --title "v$VERSION" --notes-file "$NOTES_FILE" --repo "$GITHUB_REPOSITORY"
139115
140116
- name: Commit new changelog if generated
141117
if: steps.changelog_check.outputs.changelog_exists == 'false'

0 commit comments

Comments
 (0)