Skip to content

Commit fba0058

Browse files
committed
github actions; hopefully fix windows build, add release notes
1 parent 58f0a92 commit fba0058

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,50 @@ jobs:
5252

5353
- name: Get package version
5454
id: package-version
55+
shell: bash
5556
run: echo "version=v$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
5657

5758
- name: Check if version tag exists
5859
id: tag-exists
60+
shell: bash
5961
run: |
6062
if git rev-parse "${{ steps.package-version.outputs.version }}" >/dev/null 2>&1; then
6163
echo "exists=true" >> $GITHUB_OUTPUT
6264
else
6365
echo "exists=false" >> $GITHUB_OUTPUT
6466
fi
6567
68+
- name: Generate release notes
69+
id: release-notes
70+
if: github.ref == 'refs/heads/main' && steps.tag-exists.outputs.exists == 'false'
71+
shell: bash
72+
run: |
73+
# Get the latest tag (if any)
74+
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
75+
76+
# Generate changelog
77+
if [ -n "$LATEST_TAG" ]; then
78+
echo "## What's Changed" > release_notes.md
79+
echo "" >> release_notes.md
80+
git log --pretty=format:"- %s (%h)" ${LATEST_TAG}..HEAD >> release_notes.md
81+
echo "" >> release_notes.md
82+
echo "" >> release_notes.md
83+
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${LATEST_TAG}...${{ steps.package-version.outputs.version }}" >> release_notes.md
84+
else
85+
echo "## What's Changed" > release_notes.md
86+
echo "" >> release_notes.md
87+
echo "Initial release of Git Diff Viewer!" >> release_notes.md
88+
echo "" >> release_notes.md
89+
git log --pretty=format:"- %s (%h)" >> release_notes.md
90+
fi
91+
92+
# Set output
93+
{
94+
echo 'notes<<EOF'
95+
cat release_notes.md
96+
echo EOF
97+
} >> $GITHUB_OUTPUT
98+
6699
- name: Build Tauri app (with release)
67100
if: github.ref == 'refs/heads/main' && steps.tag-exists.outputs.exists == 'false'
68101
uses: tauri-apps/tauri-action@v0
@@ -71,7 +104,7 @@ jobs:
71104
with:
72105
tagName: ${{ steps.package-version.outputs.version }}
73106
releaseName: 'Git Diff Viewer ${{ steps.package-version.outputs.version }}'
74-
releaseBody: 'See the assets to download this version and install.'
107+
releaseBody: ${{ steps.release-notes.outputs.notes }}
75108
releaseDraft: false
76109
prerelease: false
77110

0 commit comments

Comments
 (0)