Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

update workflow

tilakpatel225c6d0b71adcc
diff --git a/.github/workflows/release-production.yml b/.github/workflows/release-production.yml
index 03c51bca4..6709e3637 100644
--- a/.github/workflows/release-production.yml
+++ b/.github/workflows/release-production.yml
@@ -305,7 +305,7 @@ jobs:
REPO_URL="https://github.com/${{ github.repository }}"
cat << EOF > download_section.md
- ## Download Latest Release
+ ## 📥 Download Latest Release
**Version:** \`${TAG_NAME}\` | **Released:** $(date -u +"%Y-%m-%d")
@@ -320,19 +320,23 @@ jobs:
[View All Releases](${REPO_URL}/releases)
EOF
- # Update README if markers exist
- for README in "README.md" "fincept-terminal-desktop/README.md"; do
- if [ -f "$README" ] && grep -q "<!-- DOWNLOAD_SECTION_START -->" "$README"; then
- awk '
- /<!-- DOWNLOAD_SECTION_START -->/ {
- print; print ""; system("cat download_section.md");
- while (getline && !/<!-- DOWNLOAD_SECTION_END -->/) continue;
- print "<!-- DOWNLOAD_SECTION_END -->"; next
- }
- { print }
- ' "$README" > temp.md && mv temp.md "$README"
- fi
- done
+ # Update root README if markers exist
+ README_PATH="README.md"
+ if [ -f "$README_PATH" ] && grep -q "<!-- DOWNLOAD_SECTION_START -->" "$README_PATH"; then
+ echo "Updating $README_PATH with download links..."
+ awk '
+ /<!-- DOWNLOAD_SECTION_START -->/ {
+ print; print ""; system("cat download_section.md");
+ while (getline && !/<!-- DOWNLOAD_SECTION_END -->/) continue;
+ print ""; print "<!-- DOWNLOAD_SECTION_END -->"; next
+ }
+ { print }
+ ' "$README_PATH" > temp.md && mv temp.md "$README_PATH"
+ echo "README updated successfully"
+ else
+ echo "README.md not found or missing markers"
+ ls -la README.md || echo "File does not exist"
+ fi
rm -f download_section.md
@@ -340,13 +344,35 @@ jobs:
if: steps.check_release.outputs.exists == 'false'
run: |
TAG_NAME="${{ github.ref_name }}"
- git config --local user.email "[email protected]"
- git config --local user.name "GitHub Action Bot"
- git add README.md fincept-terminal-desktop/README.md 2>/dev/null || true
- if ! git diff --cached --quiet; then
- git commit -m "Update download links for ${TAG_NAME}"
- git push origin HEAD:main || echo "Warning: Could not push README updates"
+ # Configure git
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
+ git config --local user.name "github-actions[bot]"
+
+ # Check if README was modified
+ if [ -f "README.md" ]; then
+ git add README.md
+
+ # Check if there are changes to commit
+ if git diff --cached --quiet; then
+ echo "No changes to commit in README.md"
+ else
+ echo "Committing README.md updates..."
+ git commit -m "docs: Update download links for ${TAG_NAME} [skip ci]"
+
+ # Push to main branch
+ echo "Pushing changes to main branch..."
+ git push origin HEAD:main || {
+ echo "Failed to push to main, trying to fetch and rebase..."
+ git fetch origin main
+ git rebase origin/main
+ git push origin HEAD:main
+ }
+
+ echo "README.md successfully updated and pushed"
+ fi
+ else
+ echo "README.md not found, skipping commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}